Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
_local_preview.html
node_modules/
.claude/
_posts/drafts/
4 changes: 4 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ The published URL will be
## Architecture

- `_posts/<theme>/*.md` — markdown sources. Theme = parent folder.
- `_posts/drafts/` — local, gitignored staging area for work-in-progress drafts.
`build.js` skips it (see `EXCLUDED_THEME_DIRS`), so a draft sitting here never
renders, never lands on the homepage, and never generates a public `drafts/`
directory. Move a draft into a real `_posts/<theme>/` folder to publish it.
- `_template.html` — per-post template. Carries the full `<head>` (viewport,
favicons, OG/Twitter meta, canonical link) plus the article body wrapper.
- `_theme_template.html` — per-theme landing page template.
Expand Down
14 changes: 13 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,25 @@ function applyTemplate(template, vars) {

// ---------- post discovery ----------

// _posts/drafts/ is a local, gitignored staging area for work-in-progress
// drafts (e.g. imported from work notes). It is never rendered to the site —
// a draft gets moved into a real theme folder once it's ready to publish, at
// which point it starts building normally. Excluding it here keeps the staging
// area from leaking onto the homepage or generating a public /drafts/ dir.
const EXCLUDED_THEME_DIRS = new Set(["drafts"]);

function listThemeDirs() {
if (!fs.existsSync(POSTS_DIR)) return [];
return fs
.readdirSync(POSTS_DIR, { withFileTypes: true })
.filter((e) => e.isDirectory())
.map((e) => e.name)
.filter((name) => !name.startsWith("_") && !name.startsWith("."))
.filter(
(name) =>
!name.startsWith("_") &&
!name.startsWith(".") &&
!EXCLUDED_THEME_DIRS.has(name),
)
.sort();
}

Expand Down
Loading