Welcome to mirror list, hosted at ThFree Co, Russian Federation.

title.html « data « partials « layouts - github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 938a5da31056cd9b93c3e747a5d9781cb04abcee (plain)
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
31
32
33
34
35
{{- $title := .Title -}}
{{- $siteTitle := .Site.Title -}}

{{- if .IsHome -}}
    <!-- Homepage, and it's pagination -->

    <!-- Build paginator -->
    {{ $pages := where .Site.RegularPages "Section" "in" .Site.Params.mainSections }}
    {{ $pag := .Paginate ($pages) }}

    {{ if .Paginator.HasPrev }}
        <!-- Paginated. Append page number to title -->
        {{ $title = printf "%s - %s" .Paginator $siteTitle }}
    {{ else }}
        {{ $title = $siteTitle}}
    {{ end }}
{{- else if eq .Kind "term" -}}
    <!-- Taxonomy page -->

    <!-- Build paginator -->
    {{ $pag := .Paginate .Pages }}

    <!-- {TAXONOMY_TYPE}: {TAXONOMY_TERM} -->
    {{ $title = slice (title .Data.Singular) ": " $title }}

    {{ if .Paginator.HasPrev }}
        <!-- Add page number-->
        {{ $title = $title | append " - " .Paginator }}
    {{ end }} 

    {{ $title = $title | append " - " $siteTitle }}
    {{ $title = delimit $title "" }}
{{- end -}}

{{ return $title }}