@@ -7,6 +7,11 @@ pub fn build(b: *std.Build) !void {
77
88 // the zine dev server needs this option!!!
99 const opt_debug = b .option (bool , "debug" , "zine debug, unused" ) orelse true ;
10+ const include_drafts = b .option (
11+ bool ,
12+ "include-drafts" ,
13+ "Include drafts in zine output" ,
14+ ) orelse false ;
1015
1116 const pcre2_dep = b .dependency ("pcre2" , .{
1217 .target = target ,
@@ -15,7 +20,7 @@ pub fn build(b: *std.Build) !void {
1520 });
1621
1722 const docs_wasm = try buildDocsWasm (b , optimize );
18- const website_step , const serve_step = try buildWebSite (b , docs_wasm , opt_debug );
23+ const website_step , const serve_step = try buildWebSite (b , docs_wasm , opt_debug , include_drafts );
1924 // has to be run with zig build website
2025 _ = website_step ;
2126 // has to be run with zig build serve
@@ -54,7 +59,7 @@ fn buildDocsWasm(b: *std.Build, optimize: std.builtin.OptimizeMode) !*std.Build.
5459 return docs_wasm ;
5560}
5661
57- fn buildWebSite (b : * std.Build , docs_wasm : * std.Build.Step.Compile , debug : bool ) ! struct {
62+ fn buildWebSite (b : * std.Build , docs_wasm : * std.Build.Step.Compile , debug : bool , include_drafts : bool ) ! struct {
5863 * std .Build .Step ,
5964 * std .Build .Step ,
6065} {
@@ -107,7 +112,7 @@ fn buildWebSite(b: *std.Build, docs_wasm: *std.Build.Step.Compile, debug: bool)
107112 "website" ,
108113 "Builds the website" ,
109114 );
110- zine .addWebsite (b , opts , website_step , site );
115+ zine .addWebsite (b , opts , website_step , site , include_drafts );
111116
112117 const serve_step = b .step (
113118 "serve" ,
0 commit comments