diff options
author | Li-aung 'Lewis' Yip <liaung@gmail.com> | 2016-12-30 18:28:19 +0300 |
---|---|---|
committer | Li-aung 'Lewis' Yip <liaung@gmail.com> | 2016-12-30 18:28:19 +0300 |
commit | 3e2587ad87c8c3a8f9f4b0a90d0adcb4fc047431 (patch) | |
tree | 5c823872cf451705ce5828e6d40fbfbc079d82f6 | |
parent | b15057c11d5d3cca1870c9ac170c3a117008f9d1 (diff) |
When rendering draft posts (using -D), mark them as "DRAFT" in post titles and lists.
-rw-r--r-- | layouts/_default/list.html | 3 | ||||
-rw-r--r-- | layouts/_default/single.html | 2 | ||||
-rw-r--r-- | layouts/index.html | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 2d67838..fb39fd4 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -13,6 +13,9 @@ {{ range $name, $page := .Data.Pages }} {{ if eq .Type "post" }} <li> + {{ if .Draft }} + DRAFT: + {{ end }} <a href="{{ .Permalink }}">{{ $page.Title }}</a> <p class="footnote"> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index a8f0cbe..c0094fe 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -25,7 +25,7 @@ series:{{ range .Params.series }}<a href="{{ $baseurl }}series/{{ . | urlize }}">{{ . }}</a> {{ end }} {{ end }} </p> - <h1>{{ .Title }}</h1> + <h1>{{ if .Draft }}DRAFT: {{end}}{{ .Title }}</h1> </div> <div class="post-content"> diff --git a/layouts/index.html b/layouts/index.html index 7ecc689..29a79bf 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -13,6 +13,9 @@ {{ range $name, $page := .Site.Pages }} {{ if eq .Type "post" }} <li> + {{ if .Draft }} + DRAFT: + {{ end }} <a href="{{ .Permalink }}">{{ $page.Title }}</a> <p class="footnote"> |