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

index.html « layouts - github.com/zwbetz-gh/minimal-bootstrap-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 11f9d838b399badba335ff1bc484c3aaeaa2a27d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{{- define "main" -}}

{{ $homepage := "Home" }}
{{ with .Site.Menus.nav }}
  {{ range first 1 . }}
    {{ $homepage = .Name }}
  {{ end }}
{{ end }}
<h1>{{ $homepage }}</h1>

{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range $pages.ByPublishDate.Reverse }}
  <p>
    <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
    {{ $customDateFormat := "January 2, 2006" }}
    {{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
    <br>
    <small class="text-secondary">{{ .PublishDate.Format $customDateFormat }}</small>
    {{ partial "tags" . }}
    {{ if eq .Site.Params.showPostSummary true }}
    <br>
    {{ .Summary }}
    {{ end }}
  </p>
{{ end }}

{{- end -}}