Skip to content

Commit f1f7d04

Browse files
authored
adding draft mode, closes #1044 (#1045)
1 parent 5a2a935 commit f1f7d04

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "Franklin"
22
uuid = "713c75ef-9fc9-4b05-94a9-213340da978e"
33
authors = ["Thibaut Lienart <[email protected]>"]
4-
version = "0.10.88"
4+
version = "0.10.89"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

src/manager/write_page.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ function write_page(output_path::AS, content::AS;
8686
)
8787
set_var!(LOCAL_VARS, "fd_full_url", full_url)
8888

89+
if FD_ENV[:FINAL_PASS] && locvar(:draft)
90+
isfile(output_path) && rm(output_path)
91+
return
92+
end
93+
8994
# NOTE
9095
# - output_path is assumed to exist // see form_output_path
9196
# - head/pgfoot/foot === nothing --> read (see franklin.jl)

src/utils/vars.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ const LOCAL_VARS_DEFAULT = [
113113
"tags" => dpair(String[]),
114114
"prerender" => dpair(true), # allow specific switch
115115
"slug" => dpair(""), # allow specific target url eg: aa/bb/cc
116+
"draft" => dpair(false), # page will not be generated at built time if true
116117
# -----------------
117118
# TABLE OF CONTENTS
118119
"mintoclevel" => dpair(1), # set to 2 to ignore h1

0 commit comments

Comments
 (0)