Compare commits

...

3 Commits

Author SHA1 Message Date
Marvin Gaube 7dbf50dbc6
Merge e305a1b021 into 33e48f9892 2024-05-07 19:44:06 -05:00
Aditya Telange 33e48f9892
Add anchor link to archive layout headers 2024-05-01 13:56:39 +05:30
Marvin Gaube e305a1b021 feat: add last modified date to post meta 2023-11-19 08:33:31 +01:00
4 changed files with 22 additions and 3 deletions

View File

@ -31,3 +31,6 @@
- id: code_copied
translation: "Kopiert!"
- id: lastmod
translation: "Zuletzt geändert"

View File

@ -31,3 +31,6 @@
- id: code_copied
translation: "copied!"
- id: lastmod
translation: "Last Modified"

View File

@ -36,12 +36,21 @@
{{- range $pages.GroupByPublishDate "2006" }}
{{- if ne .Key "0001" }}
<div class="archive-year">
<h2 class="archive-year-header">
{{- replace .Key "0001" "" }}<sup class="archive-count">&nbsp;&nbsp;{{ len .Pages }}</sup>
{{- $year := replace .Key "0001" "" }}
<h2 class="archive-year-header" id="{{ $year }}">
<a class="archive-header-link" href="#{{ $year }}">
{{- $year -}}
</a>
<sup class="archive-count">&nbsp;{{ len .Pages }}</sup>
</h2>
{{- range .Pages.GroupByDate "January" }}
<div class="archive-month">
<h3 class="archive-month-header">{{- .Key }}<sup class="archive-count">&nbsp;&nbsp;{{ len .Pages }}</sup></h3>
<h3 class="archive-month-header" id="{{ $year }}-{{ .Key }}">
<a class="archive-header-link" href="#{{ $year }}-{{ .Key }}">
{{- .Key -}}
</a>
<sup class="archive-count">&nbsp;{{ len .Pages }}</sup>
</h3>
<div class="archive-posts">
{{- range .Pages }}
{{- if eq .Kind "page" }}

View File

@ -4,6 +4,10 @@
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }}
{{- end }}
{{- if and (.Param "Lastmod") (ne (.Param "Lastmod"| time.Format "2023-10-15") (.Date | time.Format "2023-10-15" )) }}
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s: %s</span>" (.Lastmod) (i18n "lastmod") (.Lastmod | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }}
{{- end }}
{{- if (.Param "ShowReadingTime") -}}
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }}
{{- end }}