Add deprecation warning to google_news template

Closes #9172
This commit is contained in:
Joe Mooring 2021-11-20 17:49:47 -08:00 committed by Bjørn Erik Pedersen
parent 5e0947c5b5
commit 75a823a36a
2 changed files with 13 additions and 6 deletions

View file

@ -200,9 +200,13 @@ if (!doNotTrack) {
{{ end }} {{ end }}
{{- end -}} {{- end -}}
`}, `},
{`google_news.html`, `{{ if .IsPage }}{{ with .Params.news_keywords }} {`google_news.html`, `{{- warnf "The google_news internal template will be removed in a future release. Please remove calls to this template. See https://github.com/gohugoio/hugo/issues/9172 for additional information." -}}
<meta name="news_keywords" content="{{ range $i, $kw := first 10 . }}{{ if $i }},{{ end }}{{ $kw }}{{ end }}" /> {{- if .IsPage -}}
{{ end }}{{ end }}`}, {{- with .Params.news_keywords -}}
<meta name="news_keywords" content="{{ range $i, $kw := first 10 . }}{{ if $i }},{{ end }}{{ $kw }}{{ end }}">
{{- end -}}
{{- end -}}
`},
{`opengraph.html`, `<meta property="og:title" content="{{ .Title }}" /> {`opengraph.html`, `<meta property="og:title" content="{{ .Title }}" />
<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" /> <meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" /> <meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" />

View file

@ -1,3 +1,6 @@
{{ if .IsPage }}{{ with .Params.news_keywords }} {{- warnf "The google_news internal template will be removed in a future release. Please remove calls to this template. See https://github.com/gohugoio/hugo/issues/9172 for additional information." -}}
<meta name="news_keywords" content="{{ range $i, $kw := first 10 . }}{{ if $i }},{{ end }}{{ $kw }}{{ end }}" /> {{- if .IsPage -}}
{{ end }}{{ end }} {{- with .Params.news_keywords -}}
<meta name="news_keywords" content="{{ range $i, $kw := first 10 . }}{{ if $i }},{{ end }}{{ $kw }}{{ end }}">
{{- end -}}
{{- end -}}