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