mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-09 14:59:45 +00:00
Show date in lists only if set by page (#154)
This commit is contained in:
parent
770fd5c0a6
commit
4c19d875de
2 changed files with 12 additions and 0 deletions
|
@ -5,9 +5,15 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<ul>
|
<ul>
|
||||||
{{ range .Pages.ByPublishDate.Reverse }}
|
{{ range .Pages.ByPublishDate.Reverse }}
|
||||||
|
{{ if .Date }}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ .Permalink }}">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | {{ .Title }}</a>
|
<a href="{{ .Permalink }}">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | {{ .Title }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
{{ else }}
|
||||||
|
<li>
|
||||||
|
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -6,9 +6,15 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<ul>
|
<ul>
|
||||||
{{ range .Pages.ByPublishDate.Reverse }}
|
{{ range .Pages.ByPublishDate.Reverse }}
|
||||||
|
{{ if .Date }}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ .Permalink }}">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | {{ .Title }}</a>
|
<a href="{{ .Permalink }}">{{ .Date.Format (.Site.Params.dateFormat | default "Jan 02, 2006") }} | {{ .Title }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
{{ else }}
|
||||||
|
<li>
|
||||||
|
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue