mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
5fa97ee964
commit
cb98e9061b
2 changed files with 13 additions and 5 deletions
|
@ -44,8 +44,10 @@
|
||||||
|
|
||||||
{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
|
{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
|
||||||
{{- $facebookAdmin := "" }}
|
{{- $facebookAdmin := "" }}
|
||||||
{{- with site.Params.social.facebook_admin }}
|
{{- with site.Params.social }}
|
||||||
{{- $facebookAdmin = . }}
|
{{- if reflect.IsMap . }}
|
||||||
|
{{- $facebookAdmin = .facebook_admin }}
|
||||||
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- with site.Social.facebook_admin }}
|
{{- with site.Social.facebook_admin }}
|
||||||
{{- $facebookAdmin = . }}
|
{{- $facebookAdmin = . }}
|
||||||
|
|
|
@ -22,8 +22,10 @@
|
||||||
|
|
||||||
{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
|
{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
|
||||||
{{- $twitterSite := "" }}
|
{{- $twitterSite := "" }}
|
||||||
{{- with site.Params.social.twitter }}
|
{{- with site.Params.social }}
|
||||||
{{- $twitterSite = . }}
|
{{- if reflect.IsMap . }}
|
||||||
|
{{- $twitterSite = .twitter }}
|
||||||
|
{{- end }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- with site.Social.twitter }}
|
{{- with site.Social.twitter }}
|
||||||
{{- $twitterSite = . }}
|
{{- $twitterSite = . }}
|
||||||
|
@ -32,5 +34,9 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- with $twitterSite }}
|
{{- with $twitterSite }}
|
||||||
<meta name="twitter:site" content="@{{ . }}"/>
|
{{- $content := . }}
|
||||||
|
{{- if not (strings.HasPrefix . "@") }}
|
||||||
|
{{- $content = printf "@%v" $twitterSite }}
|
||||||
|
{{- end }}
|
||||||
|
<meta name="twitter:site" content="{{ $content }}"/>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue