diff options
author | Fabian Tamp <fabian.tamp@gmail.com> | 2020-06-01 18:46:56 +0300 |
---|---|---|
committer | Fabian Tamp <fabian.tamp@gmail.com> | 2020-06-01 18:46:56 +0300 |
commit | 32eb5039ac773e93673befa967a8fef0e8e1cb68 (patch) | |
tree | b693202f1df54c94e3bd6a6428bfd5f25447586b | |
parent | dafebe290ca0bc82cc038adcf8f38f7cc16d3c5d (diff) |
Add dates to non-post pages, if they're available.
-rw-r--r-- | layouts/_default/single.html | 14 | ||||
-rw-r--r-- | static/css/style.css | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/layouts/_default/single.html b/layouts/_default/single.html index f21924c..574f79c 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -19,7 +19,19 @@ <section id="main" class="content-container look-sheet article-pad-v {{ if (or .Params.disableMarginNotes .Site.Params.disableMarginNotes) }}no-floating-footnotes{{ end }}" itemprop="mainEntityOfPage"> <h1 itemprop="name" id="title">{{ .Title }}</h1> - <article itemprop="articleBody" id="content" class="article-body"> + {{ if .Date }} + {{ if eq .Lastmod .Date }} + <div class="post-date"><span itemprop="datePublished">{{ .Date.Format "January 2, 2006" }}</span></div> + <meta itemprop="dateModified" content="{{ .Lastmod.Format "January 2, 2006" }}"/> + {{ else }} + <div class="post-date">Created: <span itemprop="datePublished">{{ .Date.Format "January 2, 2006" }}</span></div> + <div class="post-date">Last Edited: <span itemprop="dateModified">{{ .Lastmod.Format "January 2, 2006" }}</span></div> + {{ end }} + {{ end }} + {{ if .Draft }} + <div class="post-date">{{ .WordCount }} words</div> + {{ end }} + <article itemprop="articleBody" id="content" class="article-body margin-top-2em"> {{ .Content }} </article> </section> diff --git a/static/css/style.css b/static/css/style.css index 68422ab..9217d8f 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -167,7 +167,6 @@ nav a, nav a:hover, nav a:visited { } .post-date { - font-size: 0.875em; color: #777; } |