33` CLAUDE.md ` and ` GEMINI.md ` are symlinks to this file.
44
55## Context
6+
67Jekyll-based static site (alexgude.com) running in Docker.
78** Crucial:** Always use ` make ` commands. Never run ` jekyll ` or ` bundle ` directly.
89
910## Operations
11+
1012- ** Serve:** ` make serve ` (Live reload at localhost:4000).
1113- ** Test:** ` make test ` (Runs all tests in ` _tests/ ` ).
1214- ** Test File:** ` make test TEST=_tests/src/path/to/test.rb `
@@ -17,35 +19,39 @@ Jekyll-based static site (alexgude.com) running in Docker.
1719- ** Hooks:** ` make hooks-install ` (Install pre-commit hook).
1820
1921## Architecture Map
22+
2023- ** Content:** ` _posts/ ` (Blog), ` _books/ ` (Reviews collection).
2124- ** Layouts:** ` _layouts/ ` , ` _includes/ ` .
2225- ** Plugins:** ` _plugins/src/ ` (Domain-Driven Design).
23- - ` infrastructure/ ` : Low-level utils (Logger, Text, URL), ** Link Cache** ,
24- ` GeneratedStaticFile ` , ` MarkdownWhitespaceNormalizer ` .
25- - ` ui/ ` : Generic components (Cards, Ratings, Citations).
26- - ` seo/ ` : JSON-LD generators & Validation.
27- - ` content/ ` : Domain logic (Books, Posts, Authors, Series, ** Markdown Output** ).
26+ - ` infrastructure/ ` : Low-level utils (Logger, Text, URL), ** Link Cache** ,
27+ ` GeneratedStaticFile ` , ` MarkdownWhitespaceNormalizer ` .
28+ - ` ui/ ` : Generic components (Cards, Ratings, Citations).
29+ - ` seo/ ` : JSON-LD generators & Validation.
30+ - ` content/ ` : Domain logic (Books, Posts, Authors, Series, ** Markdown Output** ).
2831- ** Tests:** ` _tests/ ` (Mirrors ` _plugins/src/ ` structure).
2932
3033## CI/CD & Hooks
3134
3235** GitHub Actions** (` .github/workflows/jekyll.yml ` ) runs on every push:
36+
33371 . ` bundle exec rubocop ` (lint).
34382 . ` bundle exec ruby ... load test_*.rb ` (tests).
35393 . ` bundle exec ruby _bin/check_strict.rb ` (strict Liquid variables).
36404 . Build, HTML validation, broken-link check (main branch deploys).
3741
3842** Pre-commit hook** (` _bin/pre-commit.sh ` , install via ` make hooks-install ` ):
43+
3944- Runs ` rubocop --autocorrect ` inside Docker on staged ` .rb ` files.
4045- Runs ` prettier --write ` inside Docker on staged ` .md ` files (excluding meta files).
4146- Auto-corrected files are re-staged automatically.
4247- Rejects the commit if uncorrectable offenses remain.
4348
4449## Development Rules
50+
45511 . ** Separation of Concerns:**
46- - ** Tags** (` tags/ ` ) are thin wrappers; check ` render_mode ` and delegate.
47- - ** Utils** (` [domain]/[util].rb ` ) orchestrate logic.
48- - ** Finders** fetch data; ** Renderers** generate HTML.
52+ - ** Tags** (` tags/ ` ) are thin wrappers; check ` render_mode ` and delegate.
53+ - ** Utils** (` [domain]/[util].rb ` ) orchestrate logic.
54+ - ** Finders** fetch data; ** Renderers** generate HTML.
49552 . ** Error Handling:** Use ` PluginLoggerUtils.log_liquid_failure ` .
50563 . ** Testing:** Create a matching test file in ` _tests/ ` for every new class.
51574 . ** Link Cache:** The site relies on ` site.data['link_cache'] ` (built by
@@ -74,13 +80,13 @@ LLMS.TXT (:site, :post_render) [llms_txt_generator.rb]
7480
7581### Key Files (` content/markdown_output/ ` )
7682
77- | File | Purpose |
78- | ------| ---------|
79- | ` markdown_body_hook.rb ` | Pre-render hooks; re-renders content with ` render_mode: :markdown ` using standalone template (avoids cache pollution) |
80- | ` markdown_output_assembler.rb ` | Post-render hook; assembles header + body + footer into ` .md ` files |
81- | ` markdown_card_utils.rb ` | Formats card data hashes as Markdown list items (` - [Title](url) by Author --- stars ` ) |
82- | ` markdown_link_formatter.rb ` | Formats resolved link data as ` [text](url) ` for link tags |
83- | ` llms_txt_generator.rb ` | Generates ` /llms.txt ` index grouped by Blog Posts, Book Reviews, Optional |
83+ | File | Purpose |
84+ | ------------------------------ | --------------------------------------------------------------------------------------------------------------------- |
85+ | ` markdown_body_hook.rb ` | Pre-render hooks; re-renders content with ` render_mode: :markdown ` using standalone template (avoids cache pollution) |
86+ | ` markdown_output_assembler.rb ` | Post-render hook; assembles header + body + footer into ` .md ` files |
87+ | ` markdown_card_utils.rb ` | Formats card data hashes as Markdown list items (` - [Title](url) by Author --- stars ` ) |
88+ | ` markdown_link_formatter.rb ` | Formats resolved link data as ` [text](url) ` for link tags |
89+ | ` llms_txt_generator.rb ` | Generates ` /llms.txt ` index grouped by Blog Posts, Book Reviews, Optional |
8490
8591### Render Mode Pattern
8692
@@ -117,7 +123,7 @@ Tags with render_mode support: all link tags (`book_link`, `author_link`,
117123- ** Page payload snapshot:** ` Page#to_liquid ` returns a plain ` Hash `
118124 (snapshot at call time), while ` Document#to_liquid ` returns a live
119125 ` DocumentDrop ` . In ` Renderer#run ` , ` assign_pages! ` calls ` to_liquid `
120- * before * the ` :pre_render ` hook fires. Data set in ` :pre_render ` hooks is
126+ _ before _ the ` :pre_render ` hook fires. Data set in ` :pre_render ` hooks is
121127 visible for Documents (live Drop) but ** not** for Pages (stale Hash). Fix:
122128 in ` :pages ` hooks, also inject into ` payload['page'] ` directly.
123129- ** Strict Liquid:** ` render_mode ` must always be defined in the payload
@@ -130,7 +136,7 @@ Tags with render_mode support: all link tags (`book_link`, `author_link`,
130136### Excerpt and Opening Paragraph
131137
132138Jekyll's excerpt is the first "block" of content (before the first blank
133- line). A ` {% capture %} ` block placed * above * the opening paragraph becomes
139+ line). A ` {% capture %} ` block placed _ above _ the opening paragraph becomes
134140the excerpt instead of the actual paragraph text. Therefore:
135141
136142- ** ` {% capture %} ` definitions must go _ after_ the opening paragraph.**
@@ -147,10 +153,10 @@ the excerpt instead of the actual paragraph text. Therefore:
147153Simple formatting tags for non-book creative works. Emit
148154` <cite class="...-title"> ` in HTML, ` _italic_ ` in Markdown.
149155
150- | Tag | CSS class | Example |
151- | -----| -----------| ---------|
152- | ` movie_title ` | ` movie-title ` | ` {% movie_title "The Matrix" %} ` |
153- | ` game_title ` | ` game-title ` | ` {% game_title "Elden Ring" %} ` |
156+ | Tag | CSS class | Example |
157+ | --------------- | --------------- | -------------------------------- |
158+ | ` movie_title ` | ` movie-title ` | ` {% movie_title "The Matrix" %} ` |
159+ | ` game_title ` | ` game-title ` | ` {% game_title "Elden Ring" %} ` |
154160| ` tv_show_title ` | ` tv-show-title ` | ` {% tv_show_title "The Wire" %} ` |
155161
156162Accepts quoted strings or Liquid variables (` {% game_title page.title %} ` ).
0 commit comments