|
1 | 1 | <meta charset="utf-8" />
|
2 | 2 | {{ $title := "" }}
|
3 | 3 | {{ if .IsHome }}
|
4 |
| - {{ $title = printf "%s" .Site.Params.homepageTitle }} |
| 4 | +{{ $title = printf "%s" .Site.Params.homepageTitle }} |
5 | 5 | {{ else }}
|
6 |
| - {{ $type := .Type }} |
7 |
| - {{ $product := .Params.product }} |
8 |
| - |
9 |
| - {{ if (and (eq $type "neuromorphic-hardware") $product) }} |
10 |
| - {{ $title = printf "A Look at %s - %s - %s" .Page.Title "Neuromorphic Chip" .Site.Title}} |
11 |
| - {{ else }} |
12 |
| - {{ $title = printf "%s - %s" .Page.Title .Site.Title }} |
13 |
| - {{ end }} |
| 6 | +{{ $type := .Type }} |
| 7 | +{{ $product := .Params.product }} |
| 8 | + |
| 9 | +{{ if (and (eq $type "neuromorphic-hardware") $product) }} |
| 10 | +{{ $title = printf "A Look at %s - %s - %s" .Page.Title "Neuromorphic Chip" .Site.Title}} |
| 11 | +{{ else }} |
| 12 | +{{ $title = printf "%s - %s" .Page.Title .Site.Title }} |
| 13 | +{{ end }} |
14 | 14 | {{ end }}
|
15 | 15 |
|
16 | 16 |
|
|
22 | 22 |
|
23 | 23 | <link rel="canonical" href="{{ .Permalink }}" />
|
24 | 24 |
|
| 25 | +{{- /* RSS Discovery Links - Single Best Feed Strategy */ -}} |
| 26 | +{{- $feed := "" -}} |
| 27 | +{{- $feedTitle := "" -}} |
| 28 | +{{- $feedProviderPage := "" -}} |
| 29 | + |
| 30 | +{{- /* Determine the page that provides the feed (either the section page or the home page) */ -}} |
| 31 | +{{- if .IsPage -}} |
| 32 | +{{- $feedProviderPage = .Parent -}} |
| 33 | +{{- else if .IsSection -}} |
| 34 | +{{- $feedProviderPage = . -}} |
| 35 | +{{- else if .IsHome -}} |
| 36 | +{{- $feedProviderPage = . -}} |
| 37 | +{{- end -}} |
| 38 | + |
| 39 | +{{- /* Check if the identified provider page has an RSS feed and it's not the homepage (unless we are on the homepage) */ -}} |
| 40 | +{{- if and $feedProviderPage ($feedProviderPage.OutputFormats.Get "rss") -}} |
| 41 | +{{- $homeFeedPermalink := (site.Home.OutputFormats.Get "rss").Permalink -}} |
| 42 | +{{- $specificFeed := $feedProviderPage.OutputFormats.Get "rss" -}} |
| 43 | +{{- if or (ne $specificFeed.Permalink $homeFeedPermalink) .IsHome -}} |
| 44 | +{{- $feed = $specificFeed -}} |
| 45 | +{{- $feedTitle = printf "%s | %s" $feedProviderPage.Title site.Title -}} |
| 46 | +{{- end -}} |
| 47 | +{{- end -}} |
| 48 | + |
| 49 | +{{- /* Fallback to the homepage feed if no specific feed was found */ -}} |
| 50 | +{{- if not $feed -}} |
| 51 | +{{- with site.Home.OutputFormats.Get "rss" -}} |
| 52 | +{{- $feed = . -}} |
| 53 | +{{- $feedTitle = printf "%s | RSS Feed" site.Title -}} |
| 54 | +{{- end -}} |
| 55 | +{{- end -}} |
| 56 | + |
| 57 | +{{- /* Render the single link tag */ -}} |
| 58 | +{{- with $feed -}} |
| 59 | +<link rel="alternate" type="application/rss+xml" title="{{ $feedTitle }}" href="{{ .Permalink }}"> |
| 60 | +{{- end -}} |
| 61 | + |
| 62 | + |
25 | 63 | <!-- favicon -->
|
26 | 64 | <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
27 | 65 | <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
|
44 | 82 | {{ if .Params.math }}
|
45 | 83 | {{ partial "helpers/katex.html" . }}
|
46 | 84 | {{ end }}
|
47 |
| - |
|
0 commit comments