Skip to content

Commit 65bd711

Browse files
jmooringadityatelange
authored andcommitted
[PATCH] hugolib: Deprecate site methods Author, Authors, and Social
cherry-picked from gohugoio/hugo@d4d49e0
1 parent 6965792 commit 65bd711

File tree

2 files changed

+12
-26
lines changed

2 files changed

+12
-26
lines changed

‎layouts/partials/templates/opengraph.html‎

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,11 @@
4242
{{ end }}{{ end }}
4343
{{- end }}
4444

45-
{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}}
46-
{{- $facebookAdmin := "" }}
45+
{{- /* Facebook Page Admin ID for Domain Insights */}}
4746
{{- with site.Params.social }}
4847
{{- if reflect.IsMap . }}
49-
{{- $facebookAdmin = .facebook_admin }}
50-
{{- end }}
51-
{{- else }}
52-
{{- with site.Social.facebook_admin }}
53-
{{- $facebookAdmin = . }}
54-
{{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }}
48+
{{- with .facebook_admin }}
49+
<meta property="fb:admins" content="{{ . }}" />
50+
{{- end }}
5551
{{- end }}
5652
{{- end }}
57-
58-
{{- /* Facebook Page Admin ID for Domain Insights */}}
59-
{{ with $facebookAdmin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}

‎layouts/partials/templates/twitter_cards.html‎

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,16 @@
1616
{{- end }}
1717
<meta name="twitter:title" content="{{ .Title }}"/>
1818
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
19-
{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}}
19+
2020
{{- $twitterSite := "" }}
2121
{{- with site.Params.social }}
2222
{{- if reflect.IsMap . }}
23-
{{- $twitterSite = .twitter }}
24-
{{- end }}
25-
{{- else }}
26-
{{- with site.Social.twitter }}
27-
{{- $twitterSite = . }}
28-
{{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }}
29-
{{- end }}
30-
{{- end }}
31-
32-
{{- with $twitterSite }}
33-
{{- $content := . }}
34-
{{- if not (strings.HasPrefix . "@") }}
35-
{{- $content = printf "@%v" $twitterSite }}
23+
{{- with .twitter }}
24+
{{- $content := . }}
25+
{{- if not (strings.HasPrefix . "@") }}
26+
{{- $content = printf "@%v" . }}
27+
{{- end }}
28+
<meta name="twitter:site" content="{{ $content }}"/>
29+
{{- end }}
3630
{{- end }}
37-
<meta name="twitter:site" content="{{ $content }}"/>
3831
{{- end }}

0 commit comments

Comments
 (0)