From dfe863e29360fb726d1ecad92421ec3bd855f073 Mon Sep 17 00:00:00 2001 From: Spencer Brower <6729162+sbrow@users.noreply.github.com> Date: Fri, 17 Jul 2026 13:42:22 -0400 Subject: [PATCH] fix: Added `-layout` flag to set layouts dir. --- TODOS.md | 2 +- site.odin | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/TODOS.md b/TODOS.md index e29c79e..c69062e 100644 --- a/TODOS.md +++ b/TODOS.md @@ -7,6 +7,7 @@ - [ ] Instead of loading the site fresh each time in watch mode, create a `reload_site` proc, that just updates changed resources. - [ ] Only publish referenced assets. + - [ ] Split `load_page` into frontmatter-parse + body-process phases so draft pages can skip the markdown pipeline entirely - [ ] mustache data keys for opengraph, etc. - [ ] Block attributes on code fences (`{ #ex-1 }`) — hello-world.md - [ ] include-code shortcode (`{{< include-code ... >}}`) — i-ported-fd-to-odin @@ -36,7 +37,6 @@ - [ ] event based - [ ] Free cmark HTML output (`body_html`) — cmark allocates via C malloc, not the arena, so it leaks per iteration in watch mode - [ ] Rename `{{#is_post}}` to `{{#is_article}}` in templates and data model — currently hardcoded to posts section, should use `is_article` (any page with a section) instead. -- [ ] Split `load_page` into frontmatter-parse + body-process phases so draft pages can skip the markdown pipeline entirely - [ ] Mount content in VFS - [ ] commands - [ ] `build` alias of default diff --git a/site.odin b/site.odin index ddae25d..95e36a8 100644 --- a/site.odin +++ b/site.odin @@ -75,6 +75,7 @@ Flags :: struct { content_dir: string `args:"name=content" usage:"Path to content directory"`, assets_dir: string `args:"name=assets" usage:"Path to assets directory (CSS, JS, fonts, images)"`, output_dir: string `args:"name=output" usage:"Path to output directory (default: public/)"`, + layouts_dir: string `args:"name=layouts" usage:"Path to layouts directory"`, drafts: bool `args:"name=drafts" usage:"Include draft pages in the build"`, watch: bool `usage:"Rebuild on file changes (polls every 5 seconds)"`, minify: bool `args:"name=minify" usage:"Minify HTML output and CSS assets"`, @@ -186,6 +187,7 @@ site_apply_cli_flags :: proc(site: ^Site, flags: Flags) { if flags.content_dir != "" do site.content_dir = flags.content_dir if flags.assets_dir != "" do site.assets_dir = flags.assets_dir if flags.output_dir != "" do site.output_dir = flags.output_dir + if flags.layouts_dir != "" do site.layouts_dir = flags.layouts_dir if flags.drafts {site.features += {.Drafts}} if flags.watch {site.features += {.Watch}}