Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hoefling <martinhoefling@users.noreply.github.com>2019-05-05 22:56:33 +0300
committerHanzei <16541325+hanzei@users.noreply.github.com>2019-05-05 22:56:33 +0300
commit4c19d875de252c3d597b548d4606539c3f783e2e (patch)
treed9eecd8027f143be71a214912bce4d80f3de0216 /layouts
parent770fd5c0a6341a0f6b2a73539ea5751abea94df8 (diff)
Show date in lists only if set by page (#154)
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.html6
-rw-r--r--layouts/_default/taxonomy.html6
2 files changed, 12 insertions, 0 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index d7d6065..fe79f8b 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -5,9 +5,15 @@
<div class="container">
<ul>
{{ range .Pages.ByPublishDate.Reverse }}
+ {{ if .Date }}
<li>
<a href="{{ .Permalink }}">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | {{ .Title }}</a>
</li>
+ {{ else }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </li>
+ {{ end }}
{{ end }}
</ul>
</div>
diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html
index 92e1492..71d0ca3 100644
--- a/layouts/_default/taxonomy.html
+++ b/layouts/_default/taxonomy.html
@@ -6,9 +6,15 @@
<div class="container">
<ul>
{{ range .Pages.ByPublishDate.Reverse }}
+ {{ if .Date }}
<li>
<a href="{{ .Permalink }}">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | {{ .Title }}</a>
</li>
+ {{ else }}
+ <li>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </li>
+ {{ end }}
{{ end }}
</ul>
</div>