@@ -7,6 +7,11 @@ pub fn build(b: *std.Build) !void {
7
7
8
8
// the zine dev server needs this option!!!
9
9
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 ;
10
15
11
16
const pcre2_dep = b .dependency ("pcre2" , .{
12
17
.target = target ,
@@ -15,7 +20,7 @@ pub fn build(b: *std.Build) !void {
15
20
});
16
21
17
22
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 );
19
24
// has to be run with zig build website
20
25
_ = website_step ;
21
26
// has to be run with zig build serve
@@ -54,7 +59,7 @@ fn buildDocsWasm(b: *std.Build, optimize: std.builtin.OptimizeMode) !*std.Build.
54
59
return docs_wasm ;
55
60
}
56
61
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 {
58
63
* std .Build .Step ,
59
64
* std .Build .Step ,
60
65
} {
@@ -107,7 +112,7 @@ fn buildWebSite(b: *std.Build, docs_wasm: *std.Build.Step.Compile, debug: bool)
107
112
"website" ,
108
113
"Builds the website" ,
109
114
);
110
- zine .addWebsite (b , opts , website_step , site );
115
+ zine .addWebsite (b , opts , website_step , site , include_drafts );
111
116
112
117
const serve_step = b .step (
113
118
"serve" ,
0 commit comments