runtimeterror/layouts/partials/archive.html

70 lines
2.6 KiB
HTML
Raw Normal View History

2023-08-22 21:27:50 +00:00
{{ $pages := .Pages }}
{{ if .IsHome }}
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ end }}
<header class="content__header">
{{ if .IsHome }}
2023-08-23 13:58:31 +00:00
<h1>{{ site.Params.indexTitle | markdownify }}</h1>
2023-08-22 21:27:50 +00:00
{{ else }}
2024-05-31 19:38:05 +00:00
{{ if eq .Title "/slashes" }}
<h1>{{ .Title | markdownify }}</h1>
<i>My collection of <a title="what's a slashpage?" href="https://slashpages.net">slash pages↗</a>.</i><hr>
{{ else }}
<h1>{{ .Title | markdownify | lower }}{{ if eq .Kind "term" }}&nbsp;<a href="{{ .Permalink }}feed.xml" aria-label="{{ .Title }} RSS" title="{{ .Title }} RSS"><i class="fa-solid fa-square-rss"></i></a>&nbsp;</h1>
2024-06-02 03:00:46 +00:00
{{ with .Description }}<i>{{ . }}</i>{{ end }}
{{ end }}
2024-06-02 03:00:46 +00:00
<hr>
{{ end }}{{ end }}
2023-08-22 21:27:50 +00:00
{{ .Content }}
</header>
2024-06-02 03:00:46 +00:00
{{- if and (eq .Kind "taxonomy") (eq .Title "Tags") }}
{{/* /tags/ */}}
<div class="tagsArchive">
{{- range $key, $value := .Site.Taxonomies }}
{{- $slicedTags := ($value.ByCount) }}
{{- range $slicedTags }}
{{- if eq $key "tags"}}
<div><a href='/{{ $key }}/{{ (replace .Name "#" "%23") | urlize }}/' title="{{ .Name }}">{{ .Name }}</a><sup>{{ .Count }}</sup></div>
2024-01-18 22:06:53 +00:00
{{- end }}
{{- end }}
{{- end }}
2024-06-02 03:00:46 +00:00
</div>
{{- else if or (eq .Kind "taxonomy") (eq .Title "/slashes") }}
{{/* /categories/ or /slashes/ */}}
{{- $sorted := sort $pages "Title" }}
{{- range $sorted }}
{{- $postDate := .Date.Format "2006-01-02" }}
{{- $updateDate := .Lastmod.Format "2006-01-02" }}
<article class="post">
<header class="post__header">
<h1><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<p class="post__meta">
<span class="date">["{{ with $updateDate }}{{ . }}{{ else }}{{ $postDate }}{{ end }}"]</span>
</p>
</header>
<section class="post__summary">
{{ .Description }}
</section>
<hr>
</article>
{{ end }}
2023-12-22 23:12:18 +00:00
{{- else }}
{{/* regular posts archive */}}
2024-06-02 03:00:46 +00:00
{{- range (.Paginate $pages).Pages }}
2024-01-18 22:06:53 +00:00
{{- $postDate := .Date.Format "2006-01-02" }}
{{- $updateDate := .Lastmod.Format "2006-01-02" }}
<article class="post">
<header class="post__header">
2024-06-02 03:00:46 +00:00
<h1><a href="{{ .Permalink }}">{{ .Title | markdownify }}</a></h1>
<p class="post__meta">
<span class="date">["{{- $postDate }}"{{- if ne $postDate $updateDate }}, "{{ $updateDate }}"{{ end }}]</span>
</p>
2024-01-18 22:06:53 +00:00
</header>
<section class="post__summary">
2024-06-02 03:00:46 +00:00
{{if .Description }}{{ .Description }}{{ else }}{{ .Summary }}{{ end }}
2024-01-18 22:06:53 +00:00
</section>
<hr>
2024-01-18 22:06:53 +00:00
</article>
{{- end }}
2024-06-02 03:00:46 +00:00
{{- template "_internal/pagination.html" . }}
2023-12-22 23:12:18 +00:00
{{- end }}