Skip to content

About

Personal developer blog about C++ and programming. (Work in progress 🚧)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

60 Commits

Folders and files

Repository files navigation

ihtier blog

Русский

Static blog on Astro + GitHub Pages with interactive GLSL shaders, C++ WASM apps and search.

Features

  • Markdown/MDX articles with images, video, syntax highlighting
  • Interactive GLSL shaders (edit code β†’ live result)
  • C++ apps via WebAssembly (ImGui + SDL2 + Emscripten)
  • Site search (Pagefind)
  • Multilingual (EN / RU)

Quick start

npm install
npm run dev

Site available at http://localhost:4321/

Build

npm run build    # Full build (WASM + Astro + Pagefind)
npm run preview  # Preview built site

Build flags

# Include demo article
INCLUDE_DEMO=true npm run build

WASM apps

C++ β†’ WASM compilation requires Emscripten:

# Install emsdk
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk && ./emsdk install latest && ./emsdk activate latest
source ./emsdk_env.sh

# Build WASM apps
npm run build:wasm

If emcc is not found, WASM build is skipped without error. In CI (GitHub Actions) Emscripten is installed automatically.

Project structure

src/
β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ index.astro              # Redirect β†’ /en/
β”‚   └── [lang]/                  # Dynamic routes for en and ru
β”‚       β”œβ”€β”€ index.astro          # Home (mixed feed of all content)
β”‚       β”œβ”€β”€ about.astro          # About page
β”‚       β”œβ”€β”€ articles/
β”‚       β”‚   β”œβ”€β”€ index.astro      # Article listing
β”‚       β”‚   └── [slug].astro     # Individual article
β”‚       β”œβ”€β”€ etudes/
β”‚       β”‚   β”œβ”€β”€ index.astro
β”‚       β”‚   └── [slug].astro
β”‚       └── portfolio/
β”‚           β”œβ”€β”€ index.astro
β”‚           └── [slug].astro
β”œβ”€β”€ content/                     # Astro Content Collections
β”‚   β”œβ”€β”€ config.ts                # Zod schemas for all collections
β”‚   β”œβ”€β”€ articles/
β”‚   β”‚   β”œβ”€β”€ en/                  # English articles (.mdx)
β”‚   β”‚   └── ru/                  # Russian articles (.mdx)
β”‚   β”œβ”€β”€ etudes/
β”‚   β”‚   β”œβ”€β”€ en/
β”‚   β”‚   └── ru/
β”‚   └── portfolio/
β”‚       β”œβ”€β”€ en/
β”‚       └── ru/
β”œβ”€β”€ layouts/
β”‚   └── Base.astro               # Base layout (head, body structure)
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ SiteHeader.astro         # Top navigation bar
β”‚   β”œβ”€β”€ NavSidebar.astro         # Left sidebar navigation
β”‚   β”œβ”€β”€ SiteFooter.astro         # Footer
β”‚   β”œβ”€β”€ MixedFeed.astro          # Home page feed (all content types)
β”‚   β”œβ”€β”€ PostList.astro           # Listing page post list
β”‚   β”œβ”€β”€ AboutEn.astro            # About page content (English)
β”‚   β”œβ”€β”€ AboutRu.astro            # About page content (Russian)
β”‚   β”œβ”€β”€ ShaderEditor.astro       # Interactive GLSL editor
β”‚   β”œβ”€β”€ VideoEmbed.astro         # YouTube embed
β”‚   └── WasmApp.astro            # WASM app embed (iframe)
β”œβ”€β”€ styles/
β”‚   └── global.css               # Global styles
└── i18n.ts                      # UI translations
wasm-apps/
β”œβ”€β”€ build.sh                     # Build script for all WASM apps
└── imgui-demo/
    β”œβ”€β”€ main.cpp                 # ImGui demo app
    └── shell.html               # Emscripten HTML shell
public/wasm/                     # Compiled WASM files (generated)
src/includePost.ts               # INCLUDE_DEMO
.github/workflows/deploy.yml    # Auto-deploy to GitHub Pages

Adding articles

1. Create file

Articles are .mdx files in src/content/articles/{lang}/:

src/content/articles/en/my-article.mdx
src/content/articles/ru/my-article.mdx

2. Frontmatter

---
title: "Article title"
date: "2026-03-06"
summary: "Short description shown in listings."
---

No layout field needed β€” it is applied automatically.

3. Content

Standard Markdown + components:

import ShaderEditor from "../../../components/ShaderEditor.astro";
import VideoEmbed from "../../../components/VideoEmbed.astro";
import WasmApp from "../../../components/WasmApp.astro";

## Text

Text with **formatting** and `code`.

## Image

![description](/images/my-image.png)

## Video

<VideoEmbed src="https://www.youtube.com/watch?v=..." title="Title" />

## Shader

<ShaderEditor title="My shader" fragment={`precision mediump float;
uniform float u_time;
uniform vec2 u_resolution;
void main() {
    vec2 st = gl_FragCoord.xy / u_resolution;
    gl_FragColor = vec4(st, 0.5 + 0.5 * sin(u_time), 1.0);
}`} />

## WASM app

<WasmApp src="/wasm/my-app/index.html" title="My app" height="450px" />

Articles appear automatically on the home page and the /en/articles/ listing β€” no need to edit any index file.

The same structure applies to etudes (src/content/etudes/) and portfolio (src/content/portfolio/).

Adding WASM apps

  1. Create wasm-apps/my-app/ with main.cpp
  2. Add compilation to wasm-apps/build.sh
  3. Output goes to public/wasm/my-app/
  4. Embed in article: <WasmApp src="/wasm/my-app/index.html" />

Deploy

  1. Create a GitHub repository
  2. In Settings β†’ Pages β†’ Source select "GitHub Actions"
  3. Update site in astro.config.mjs to your URL
  4. Push to main β€” deploy happens automatically

Adding a new language

  1. Add locale to astro.config.mjs β†’ i18n.locales
  2. Add translations to src/i18n.ts
  3. Add content directories: src/content/articles/{lang}/, src/content/etudes/{lang}/, src/content/portfolio/{lang}/
  4. Add { params: { lang: "..." } } to getStaticPaths() in all [lang]/*.astro and [lang]/**/index.astro files
  5. Create src/components/About{Lang}.astro and update src/pages/[lang]/about.astro

About

Personal developer blog about C++ and programming. (Work in progress 🚧)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages