aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/base-discovery.html
blob: 0cd956aba88ae683ca372b21974478fc5e5a1938 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{{- partial "generate-authors" . -}}

{{-
  $authorData := (dict
    "Context" .
    "AuthorDefaultUser" .Site.Author.default.home
  )
-}}

{{- $author := partial "function-authors-data.html" (dict "Data" $authorData) -}}

<link
  rel="alternate"
  type="application/rss+xml"
  title="{{ $author.name }}'s Feed"
  href="{{ .Site.BaseURL }}/{{ $author.user }}/rss.xml"
/>

{{- with $author.feeds.rss }}
  {{ range $author.feeds.rss }}
    {{ $data := split . " " }}
    {{- $url := delimit (first 1 $data) "" -}}
    {{- $retitle := trim (delimit (after 1 $data) " ") " " -}}
    {{- $retitle := and $retitle (print $retitle "'s Feed") -}}

    <link
      rel="alternate"
      type="application/rss+xml"
      title="{{ or $retitle $url }}"
      href="{{ $url }}"
    />
  {{ end }}
{{ end }}

{{- if (eq .Page.Kind "taxonomy") -}}
<link
  rel="alternate"
  type="application/rss+xml"
  title="{{ .Title }} Feed"
  href="{{ .Permalink }}rss.xml"
/>
{{- end -}}

{{- if (eq .Page.Kind "term") -}}
<link
  rel="alternate"
  type="application/rss+xml"
  title="#{{ lower .Title }} Tag Feed"
  href="{{ .Permalink }}rss.xml"
/>
{{- end }}