fix: Added -layout flag to set layouts dir.

This commit is contained in:
Spencer Brower
2026-07-17 13:42:22 -04:00
parent 528bef3941
commit dfe863e293
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -7,6 +7,7 @@
- [ ] Instead of loading the site fresh each time in watch mode, create a - [ ] Instead of loading the site fresh each time in watch mode, create a
`reload_site` proc, that just updates changed resources. `reload_site` proc, that just updates changed resources.
- [ ] Only publish referenced assets. - [ ] 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. - [ ] mustache data keys for opengraph, etc.
- [ ] Block attributes on code fences (`{ #ex-1 }`) — hello-world.md - [ ] Block attributes on code fences (`{ #ex-1 }`) — hello-world.md
- [ ] include-code shortcode (`{{< include-code ... >}}`) — i-ported-fd-to-odin - [ ] include-code shortcode (`{{< include-code ... >}}`) — i-ported-fd-to-odin
@@ -36,7 +37,6 @@
- [ ] event based - [ ] event based
- [ ] Free cmark HTML output (`body_html`) — cmark allocates via C malloc, not the arena, so it leaks per iteration in watch mode - [ ] 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. - [ ] 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 - [ ] Mount content in VFS
- [ ] commands - [ ] commands
- [ ] `build` alias of default - [ ] `build` alias of default
+2
View File
@@ -75,6 +75,7 @@ Flags :: struct {
content_dir: string `args:"name=content" usage:"Path to content directory"`, 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)"`, 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/)"`, 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"`, drafts: bool `args:"name=drafts" usage:"Include draft pages in the build"`,
watch: bool `usage:"Rebuild on file changes (polls every 5 seconds)"`, watch: bool `usage:"Rebuild on file changes (polls every 5 seconds)"`,
minify: bool `args:"name=minify" usage:"Minify HTML output and CSS assets"`, 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.content_dir != "" do site.content_dir = flags.content_dir
if flags.assets_dir != "" do site.assets_dir = flags.assets_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.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.drafts {site.features += {.Drafts}}
if flags.watch {site.features += {.Watch}} if flags.watch {site.features += {.Watch}}