mirror of https://github.com/theNewDynamic/gohugo-theme-ananke.git

Patrick Kollitsch
07.44.2026 c31ff8582907a3d06dcd524980895c7860befb99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{{- /*
  Renders the section label above the article title, linked to a page within
  the section. The link target is controlled by the `ananke.section_link`
  parameter (page front matter, or site params for a site-wide default):
 
    - unset (default): the section index page (its `_index.md`)
    - "first":         the first page of the section, honouring its sort order
    - "<path>":        a specific page, resolved relative to the section
                       (e.g. "introduction" or "/about")
 
  The visible label is always the section title; only the destination changes.
*/ -}}
{{- with .CurrentSection -}}
  {{- $section := . -}}
  {{- $target := $section -}}
  {{- with $.Param "ananke.section_link" -}}
    {{- if eq . "first" -}}
      {{- with first 1 $section.RegularPages -}}
        {{- $target = index . 0 -}}
      {{- end -}}
    {{- else -}}
      {{- with $section.GetPage . -}}
        {{- $target = . -}}
      {{- end -}}
    {{- end -}}
  {{- end -}}
  <aside class="instapaper_ignoref b helvetica tracked ttu">
    <a class="link dim" href="{{ $target.Permalink }}">{{ $section.Title }}</a>
  </aside>
{{- end -}}