mirror of
				https://github.com/Wonderfall/hugo-WonderMod.git
				synced 2025-10-30 19:35:26 +01:00 
			
		
		
		
	[PATCH] tpl/tplimpl: Deprecate .Site.Social usage with internal templates
cherry-picked from 4910312ee7
			
			
This commit is contained in:
		 Joe Mooring
					Joe Mooring
				
			
				
					committed by
					
						 Aditya Telange
						Aditya Telange
					
				
			
			
				
	
			
			
			 Aditya Telange
						Aditya Telange
					
				
			
						parent
						
							102e089bc3
						
					
				
				
					commit
					3fb112bc85
				
			| @@ -50,5 +50,16 @@ | |||||||
| {{ end }}{{ end }} | {{ end }}{{ end }} | ||||||
| {{- end }} | {{- end }} | ||||||
|  |  | ||||||
|  | {{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} | ||||||
|  | {{- $facebookAdmin := "" }} | ||||||
|  | {{- with site.Params.social.facebook_admin }} | ||||||
|  |   {{- $facebookAdmin = . }} | ||||||
|  | {{- else }} | ||||||
|  |   {{- with site.Social.facebook_admin }} | ||||||
|  |     {{- $facebookAdmin = . }} | ||||||
|  |     {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
| {{- /* Facebook Page Admin ID for Domain Insights */}} | {{- /* Facebook Page Admin ID for Domain Insights */}} | ||||||
| {{- with site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} | {{ with $facebookAdmin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} | ||||||
|   | |||||||
| @@ -28,6 +28,17 @@ | |||||||
| {{- end }} | {{- end }} | ||||||
| <meta name="twitter:title" content="{{ .Title }}"/> | <meta name="twitter:title" content="{{ .Title }}"/> | ||||||
| <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> | <meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> | ||||||
| {{ with site.Social.twitter -}} | {{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} | ||||||
|  | {{- $twitterSite := "" }} | ||||||
|  | {{- with site.Params.social.twitter }} | ||||||
|  |   {{- $twitterSite = . }} | ||||||
|  | {{- else }} | ||||||
|  |   {{- with site.Social.twitter }} | ||||||
|  |     {{- $twitterSite = . }} | ||||||
|  |     {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} | ||||||
|  |   {{- end }} | ||||||
|  | {{- end }} | ||||||
|  |  | ||||||
|  | {{- with $twitterSite }} | ||||||
| <meta name="twitter:site" content="@{{ . }}"/> | <meta name="twitter:site" content="@{{ . }}"/> | ||||||
| {{ end -}} | {{- end }} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user