mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-31 03:45:24 +01:00 
			
		
		
		
	templates: 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
series:
    - My Series
```
```gohtml
{{/* in a template */}}
{{- $series := index .Site.Taxonomies.series$name }}
{{/* was resolved to */}}
{{- $series := index {'my-series': ...} "MySeries" }}
```
(cherry picked from commit d2d493ab5d6a054001a8448ea0de2949dac4b30e)
			
			
This commit is contained in:
		 Maciej Sawicki
					Maciej Sawicki
				
			
				
					committed by
					
						 Aditya Telange
						Aditya Telange
					
				
			
			
				
	
			
			
			 Aditya Telange
						Aditya Telange
					
				
			
						parent
						
							f5417ab6d0
						
					
				
				
					commit
					d6b2282582
				
			| @@ -46,7 +46,7 @@ | |||||||
| {{- $permalink := .Permalink }} | {{- $permalink := .Permalink }} | ||||||
| {{- $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }} | {{- $siteSeries := .Site.Taxonomies.series }}{{ with .Params.series }} | ||||||
| {{- range $name := . }} | {{- range $name := . }} | ||||||
|   {{- $series := index $siteSeries $name }} |   {{- $series := index $siteSeries ($name | urlize) }} | ||||||
|   {{- range $page := first 6 $series.Pages }} |   {{- range $page := first 6 $series.Pages }} | ||||||
|     {{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }} |     {{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }} | ||||||
|   {{- end }} |   {{- end }} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user