Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding draft mode #1045

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Franklin"
uuid = "713c75ef-9fc9-4b05-94a9-213340da978e"
authors = ["Thibaut Lienart <[email protected]>"]
version = "0.10.88"
version = "0.10.89"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
5 changes: 5 additions & 0 deletions src/manager/write_page.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ function write_page(output_path::AS, content::AS;
)
set_var!(LOCAL_VARS, "fd_full_url", full_url)

if FD_ENV[:FINAL_PASS] && locvar(:draft)
isfile(output_path) && rm(output_path)
return
end

# NOTE
# - output_path is assumed to exist // see form_output_path
# - head/pgfoot/foot === nothing --> read (see franklin.jl)
Expand Down
1 change: 1 addition & 0 deletions src/utils/vars.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const LOCAL_VARS_DEFAULT = [
"tags" => dpair(String[]),
"prerender" => dpair(true), # allow specific switch
"slug" => dpair(""), # allow specific target url eg: aa/bb/cc
"draft" => dpair(false), # page will not be generated at built time if true
# -----------------
# TABLE OF CONTENTS
"mintoclevel" => dpair(1), # set to 2 to ignore h1
Expand Down