Tags and Taxonomies Without Database in C
Generating /tags/c.html automatically from frontmatter tags: [c, blog] using hash maps in C.
How Tags Work
In post:
tags: [c, blog]
Builder:
- Scan all
master_array -
tags_map[tag] -> array of posts - For each tag, render
templates/layouts/tag.cax
CAXObject *tags_map = cax_object_new();
for each post:
for each tag in post.tags:
add post to tags_map[tag]
Now /tags/c/index.html exists with 5 posts. No DB, just C arrays. Jekyll would be proud.