How this blog is built
A personal site where the blog comes first and the wiki is a module — how notes become pages, how books are read online, and how shaders run inside posts.
This site has two halves: the blog you are reading, and the wiki that lives underneath it. The blog is for writing and work meant for other people; the wiki is my learning notebook, organised after Karpathy's "LLM Wiki" idea — books and articles go into raw/, and an AI compiles them into interlinked knowledge pages.
From notes to pages
The wiki is its own Git repository. The site only reads it and never writes back. At build time a custom content loader pulls in the few hundred Markdown pages under wiki/ and does a few things on the way:
- resolves Obsidian-style
[[wikilinks]]into site links, flagging unresolved targets for the health report; - renders formulas with KaTeX and lazy-loads Mermaid diagrams only when they scroll near;
- computes backlinks, so every page shows which pages cite it;
- derives "previous / next" from the order on each domain's map page.
Reading the books online
raw/ holds several PDFs that weigh hundreds of megabytes. The reader uses pdf.js with HTTP Range requests: opening a 270 MB book transfers only about 4 MB up front, fetching pages as you go. EPUBs render with epub.js, and your reading position is remembered in the browser.
Shaders inside posts
Graphics is hard to feel through prose alone, so posts can embed editable fragment shaders. Here is one — change a number in the code and it recompiles immediately.
也可以直接改右边的代码:停手约 0.3 秒会自动重新运行;改坏了点「还原代码」。
The floating ice on the home page follows the same idea: a raymarched fragment shader where the blobs merge through a smooth union, and thickness is estimated by sampling the distance field against the normal — thinner parts glow more.
What's next
Rewriting the key wiki pages into "lessons" one by one: intuition first, then the theory, with hand-drawn diagrams and shaders you can edit. The first batch follows The Book of Shaders' procedural-shading track. (The lessons themselves are in Chinese.)