small fixes

This commit is contained in:
teldra 2022-06-15 10:42:34 +02:00
parent 13c26b1b02
commit e6c1754bd3
3 changed files with 16 additions and 16 deletions

View File

@ -1 +1 @@
news = '/news/:year/:month/:day/:title/'
news = '/news/:year/:month/:day/:slug/'

View File

@ -16,3 +16,6 @@
}
}
.underline {
text-decoration: underline;
}

View File

@ -1,18 +1,15 @@
{{ if ne .context.Content "" }}
{{ partial "snippets/content" (dict "content" .context.Content) }}
{{ end }}
<section>
{{ $prev := 3000}}
{{range where site.RegularPages "Type" "in" site.Params.searchSections }}
{{ $date := .Date }}
{{ if gt $prev ($date.Format "2006") }}
<h2 style="margin-bottom: 0;">{{ $date.Format "2006" }}</h2>
{{end}}
<div class="frow" style="margin-bottom: .2rem; margin-left: .2rem;">
<div class="underline"><a href="{{.Permalink}}">{{ .Title }}</a></div>
<div style="margin-left: .2rem;">{{- $date.Format "02" }}. {{ if $date.Format "Jan" | i18n }}{{ $date.Format "Jan" | i18n -}}{{- else -}} {{- $date.Format "Jan" -}}{{- end }} {{ $date.Format "2006" }}</div>
</div>
{{ $prev = $date.Format "2006"}}
{{end}}
</section>
<div>
{{ $pages := where site.RegularPages "Type" "in" site.Params.searchSections }}
{{ range $pages.GroupByDate "2006" }}
<h2>{{ .Key }}</h2>
{{ range .Pages.GroupByDate "January" }}
<h3 style="margin-left: 1em;">{{ .Key }}:</h3>
{{ range .Pages }}
<h4 style="margin-left: 2em;">{{ .Date.Format "02.01.2006" }} <a href="{{ .Permalink }}" class="underline">{{ .Title }}</a></h4>
{{ end }}
{{ end }}
{{ end }}
</div>