Skip to content

Commit

Permalink
adding draft mode, closes #1044 (#1045)
Browse files Browse the repository at this point in the history
  • Loading branch information
tlienart authored Aug 11, 2023
1 parent 5a2a935 commit f1f7d04
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
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 <tlienart@me.com>"]
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

2 comments on commit f1f7d04

@tlienart
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/89423

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.10.89 -m "<description of version>" f1f7d044dc95ba0d9f368a3d1afc233eb58a59cf
git push origin v0.10.89

Please sign in to comment.