aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl/tplimpl/embedded/templates/opengraph.html
diff options
context:
space:
mode:
authorMaciej Sawicki <[email protected]>2020-12-16 12:13:30 +0100
committerGitHub <[email protected]>2020-12-16 12:13:30 +0100
commitd2d493ab5d6a054001a8448ea0de2949dac4b30e (patch)
treee41609bd1e3294c68cd4df94a75938d5ef65cfd1 /tpl/tplimpl/embedded/templates/opengraph.html
parentce96895debb67df20ae24fb5f0f04b98a30cc6cc (diff)
downloadhugo-d2d493ab5d6a054001a8448ea0de2949dac4b30e.tar.gz
hugo-d2d493ab5d6a054001a8448ea0de2949dac4b30e.zip
tpl: Fix series detection in opengraph
When inside front matter you specified series with spaces, then the opengraph template wouldn't detect other articles, because in `.Site.Taxonomies.series` they are stored by urlized key. Example: ```yaml # in front matter series: - My Series ``` ```gohtml {{/* in a template */}} {{- $series := index .Site.Taxonomies.series$name }} {{/* was resolved to */}} {{- $series := index {'my-series': ...} "MySeries" }} ```
Diffstat (limited to 'tpl/tplimpl/embedded/templates/opengraph.html')
-rw-r--r--tpl/tplimpl/embedded/templates/opengraph.html2
1 files changed, 1 insertions, 1 deletions
diff --git a/tpl/tplimpl/embedded/templates/opengraph.html b/tpl/tplimpl/embedded/templates/opengraph.html
index 07d9775d0..87e986eb3 100644
--- a/tpl/tplimpl/embedded/templates/opengraph.html
+++ b/tpl/tplimpl/embedded/templates/opengraph.html
@@ -38,7 +38,7 @@
{{- $permalink := .Permalink }}
{{- $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }}
{{- range $name := . }}
- {{- $series := index $siteSeries $name }}
+ {{- $series := index $siteSeries ($name | urlize) }}
{{- range $page := first 6 $series.Pages }}
{{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }}
{{- end }}