Compare commits

...

3 Commits

Author SHA1 Message Date
Christian d55833dbce
Merge 05ba5a763f into 33e48f9892 2024-05-05 15:20:32 +08:00
Aditya Telange 33e48f9892
Add anchor link to archive layout headers 2024-05-01 13:56:39 +05:30
zeeZ 05ba5a763f improve breadcrumb schema generation 2024-03-29 18:50:35 +01:00
2 changed files with 17 additions and 6 deletions

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

@ -21,6 +21,7 @@
{{- $url := replace .Parent.Permalink ( printf "%s" site.Home.Permalink) "" }}
{{- $lang_url := strings.TrimPrefix ( printf "%s/" .Lang) $url }}
{{- $bc_list := (split $lang_url "/")}}
{{- $position := 0 }}
{{- $scratch := newScratch }}
<script type="application/ld+json">
@ -34,10 +35,11 @@
{{- $bc_pg := site.GetPage ($scratch.Get "path") -}}
{{- if (and ($bc_pg) (gt (len . ) 0))}}
{{- $position = add 1 $position }}
{{- if (and $index)}}, {{end }}
{
"@type": "ListItem",
"position": {{ add 1 $index }},
"position": {{ $position }},
"name": {{ $bc_pg.Name }},
"item": {{ $bc_pg.Permalink | safeHTML }}
}
@ -45,10 +47,10 @@
{{- end }}
{{- /* self-page addition */ -}}
{{- if (ge (len $bc_list) 2) }}, {{end }}
{{- if (gt $position 0) }}, {{end }}
{
"@type": "ListItem",
"position": {{len $bc_list}},
"position": {{ add 1 $position }},
"name": {{ .Name }},
"item": {{ .Permalink | safeHTML }}
}