setup
This commit is contained in:
27
themes/hugo-theme-monochrome/layouts/partials/list.html
Normal file
27
themes/hugo-theme-monochrome/layouts/partials/list.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{{ $show_date := .show_date | default true }}
|
||||
{{ $pages := .pages }}
|
||||
{{ $group_by_year := .group_by_year | default true }}
|
||||
|
||||
{{- if $pages -}}
|
||||
{{- if $show_date -}}
|
||||
{{- $pages = $pages.ByPublishDate.Reverse -}}
|
||||
{{- end -}}
|
||||
<ul class="list-layout">
|
||||
{{ range $pages }}
|
||||
<li>
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{- .Title -}}
|
||||
</a>
|
||||
{{ if $show_date }}
|
||||
<span>
|
||||
{{ if $group_by_year }}
|
||||
{{- .PublishDate.Format "01/02" -}}
|
||||
{{ else }}
|
||||
{{- .PublishDate.Format "2006/01/02" -}}
|
||||
{{ end }}
|
||||
</span>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user