diff options
| author | Jieiku | 2022-09-19 10:51:12 -0700 |
|---|---|---|
| committer | Jieiku | 2022-09-19 10:51:12 -0700 |
| commit | bca64259827edb25a19c4b910ab28907b0b29d93 (patch) | |
| tree | 62756e530cb1a618e96a40b37a20b0de32b0b6a7 | |
| parent | 7d691159df6e0f64129d3c11f4e8026dca3a72d1 (diff) | |
| download | abridge-bca64259827edb25a19c4b910ab28907b0b29d93.tar.gz abridge-bca64259827edb25a19c4b910ab28907b0b29d93.tar.bz2 abridge-bca64259827edb25a19c4b910ab28907b0b29d93.zip | |
menu-draft-check
| -rw-r--r-- | config.toml | 8 | ||||
| -rw-r--r-- | content/pages/about.md | 1 | ||||
| -rw-r--r-- | templates/base.html | 18 |
3 files changed, 22 insertions, 5 deletions
diff --git a/config.toml b/config.toml index 48ff03b..5b24c3c 100644 --- a/config.toml +++ b/config.toml @@ -69,15 +69,15 @@ headhr = false # show or hide horizontal rule below header foothr = true # show or hide horizontal rule above footer menu = [ - {url = "/about/", name = "About", slash = true, blank = false}, + {url = "/about/", name = "About", slash = true, blank = false, md = "pages/about.md"}, {url = "/posts/", name = "Posts", slash = true, blank = false}, {url = "/categories/", name = "Categories", slash = true, blank = false}, {url = "/tags/", name = "Tags", slash = true, blank = false}, ] menu_footer = [ - {url = "/about/", name = "About", slash = true, blank = false}, - {url = "/contact/", name = "Contact", slash = true, blank = false}, - {url = "/privacy/", name = "Privacy", slash = true, blank = false}, + {url = "/about/", name = "About", slash = true, blank = false, md = "pages/about.md"}, + {url = "/contact/", name = "Contact", slash = true, blank = false, md = "pages/contact.md"}, + {url = "/privacy/", name = "Privacy", slash = true, blank = false, md = "pages/privacy.md"}, {url = "/sitemap.xml", name = "Sitemap", slash = false, blank = true}, ] diff --git a/content/pages/about.md b/content/pages/about.md index 9166981..a9c9368 100644 --- a/content/pages/about.md +++ b/content/pages/about.md @@ -1,6 +1,7 @@ +++ title = "About" path = "about" +draft = false template = "pages.html" +++ diff --git a/templates/base.html b/templates/base.html index 0177ea1..a250d2d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -52,8 +52,24 @@ <div> <ul> {%- for i in config.extra.menu -%} - <li> <h2><a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>{{ i.name | safe }}</a></h2> </li> + + {%- if i.md -%}{# check if page is draft #} + + {%- set pagecheck = get_page(path=i.md, metadata_only=true) -%} + {%- if pagecheck.draft -%} + {%- else -%} + <li> <h2><a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>{{ i.name | safe }}</a></h2> </li> + {%- endif -%} + + {%- else -%} + + <li> <h2><a href="{{ get_url(path=i.url, trailing_slash=i.slash) }}{%- if i.slash and config.extra.uglyurls %}index.html{%- endif %}"{% if i.blank %} target="_blank"{% endif %}>{{ i.name | safe }}</a></h2> </li> + + {%- endif -%}{# end check if page is draft #} + {%- endfor -%} + + {%- if config.extra.js_theme -%} <li class="js">{%- if config.extra.icon_adjust -%}<i type="reset" id="mode" class="{{ config.extra.icon_adjust }}"></i>{%- else -%}<i type="reset" id="mode" class="mode">☀</i>{%- endif -%}</li> {%- endif -%} |
