main
html 32 lines 1.27 KB
Raw
1 {{- $page := . -}}
2 {{- $archiveURL := "archive/" | absURL -}}
3 {{- $rssURL := "index.xml" | absURL -}}
4 {{- $searchURL := "search/" | absURL -}}
5 {{- $topicsURL := "topics/" | absURL -}}
6 {{- $categoriesURL := "categories/" | absURL -}}
7 {{- $isWeekly := eq $page.Type "weekly" -}}
8 {{- $monthlyURL := "monthly/" | absURL -}}
9 {{- $yearlyURL := "yearly/" | absURL -}}
10 {{- $podcastURL := site.Params.podcast_url | default "" | strings.TrimSpace -}}
11 {{- if $isWeekly -}}
12 {{- with site.GetPage (printf "/monthly/%s/%s" ($page.Date.Format "2006") ($page.Date.Format "01")) -}}
13 {{- $monthlyURL = .RelPermalink -}}
14 {{- end -}}
15 {{- with site.GetPage (printf "/yearly/%s" ($page.Date.Format "2006")) -}}
16 {{- $yearlyURL = .RelPermalink -}}
17 {{- end -}}
18 {{- end -}}
19 <nav class="report-shortcuts" aria-label="Report navigation">
20 {{- if $isWeekly }}
21 <a href="{{ $archiveURL }}">Archive</a>
22 <a href="{{ $monthlyURL }}">Monthly</a>
23 <a href="{{ $yearlyURL }}">Yearly</a>
24 {{- end }}
25 <a href="{{ $topicsURL }}">Topics</a>
26 <a href="{{ $categoriesURL }}">Categories</a>
27 <a href="{{ $searchURL }}">Search</a>
28 <a href="{{ $rssURL }}">RSS</a>
29 {{- if and $isWeekly $podcastURL }}
30 <a href="{{ $podcastURL | safeURL }}" target="_blank" rel="noopener noreferrer">Spotify</a>
31 {{- end }}
32 </nav>