mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-31 03:45:24 +01:00 
			
		
		
		
	[PATCH] tpl/tplimpl: Fix deprecation logic in embedded templates
cherry-picked from cb98e9061b
			
			
This commit is contained in:
		 Joe Mooring
					Joe Mooring
				
			
				
					committed by
					
						 Aditya Telange
						Aditya Telange
					
				
			
			
				
	
			
			
			 Aditya Telange
						Aditya Telange
					
				
			
						parent
						
							3fb112bc85
						
					
				
				
					commit
					87df659c18
				
			| @@ -30,8 +30,10 @@ | ||||
| <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> | ||||
| {{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} | ||||
| {{- $twitterSite := "" }} | ||||
| {{- with site.Params.social.twitter }} | ||||
|   {{- $twitterSite = . }} | ||||
| {{- with site.Params.social }} | ||||
|   {{- if reflect.IsMap . }} | ||||
|     {{- $twitterSite = .twitter }} | ||||
|   {{- end }} | ||||
| {{- else }} | ||||
|   {{- with site.Social.twitter }} | ||||
|     {{- $twitterSite = . }} | ||||
| @@ -40,5 +42,9 @@ | ||||
| {{- end }} | ||||
|  | ||||
| {{- with $twitterSite }} | ||||
| <meta name="twitter:site" content="@{{ . }}"/> | ||||
|   {{- $content := . }} | ||||
|   {{- if not (strings.HasPrefix . "@") }} | ||||
|     {{- $content = printf "@%v" $twitterSite }} | ||||
|   {{- end }} | ||||
| <meta name="twitter:site" content="{{ $content }}"/> | ||||
| {{- end }} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user