Updated to author params and GoogleAnalytics params with Hugo v0.120.0.
This commit is contained in:
parent
94a6dc0af3
commit
106d3df37e
4 changed files with 17 additions and 18 deletions
|
|
@ -23,11 +23,11 @@
|
||||||
{{ with $.Param "favicon" -}}
|
{{ with $.Param "favicon" -}}
|
||||||
"favicon": "{{ . | absURL }}",
|
"favicon": "{{ . | absURL }}",
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ with site.Author.name -}}
|
{{ with site.Params.author.name -}}
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "{{ . }}"{{ with site.Author.url }},
|
"name": "{{ . }}"{{ with site.Params.author.url }},
|
||||||
"url": "{{ . }}"{{ end }}{{ with site.Author.avatar }},
|
"url": "{{ . }}"{{ end }}{{ with site.Params.author.avatar }},
|
||||||
"avatar": "{{ . | absURL }}"{{ end }}
|
"avatar": "{{ . | absURL }}"{{ end }}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -15,11 +15,11 @@
|
||||||
{{ with site.LanguageCode -}}
|
{{ with site.LanguageCode -}}
|
||||||
<language>{{ . }}</language>
|
<language>{{ . }}</language>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ with site.Author.email -}}
|
{{ with site.Params.author.email -}}
|
||||||
<managingEditor>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</managingEditor>
|
<managingEditor>{{ . }}{{ with site.Params.author.name }} ({{ . }}){{ end }}</managingEditor>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ with site.Author.email -}}
|
{{ with site.Params.author.email -}}
|
||||||
<webMaster>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</webMaster>
|
<webMaster>{{ . }}{{ with site.Params.author.name }} ({{ . }}){{ end }}</webMaster>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ with site.Copyright -}}
|
{{ with site.Copyright -}}
|
||||||
<copyright>{{ . }}</copyright>
|
<copyright>{{ . }}</copyright>
|
||||||
|
|
@ -35,8 +35,8 @@
|
||||||
<title>{{ .Title }}</title>
|
<title>{{ .Title }}</title>
|
||||||
<link>{{ .Permalink }}</link>
|
<link>{{ .Permalink }}</link>
|
||||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||||
{{ with site.Author.email -}}
|
{{ with site.Params.author.email -}}
|
||||||
<author>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</author>
|
<author>{{ . }}{{ with site.Params.author.name }} ({{ . }}){{ end }}</author>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
<guid>{{ .Permalink }}</guid>
|
<guid>{{ .Permalink }}</guid>
|
||||||
<description>{{ .Content | html }}</description>
|
<description>{{ .Content | html }}</description>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
{{ $gaid := (or site.Config.Services.GoogleAnalytics.ID site.GoogleAnalytics) -}}
|
||||||
{{ $opts := dict
|
{{ $opts := dict
|
||||||
"minify" true
|
"minify" true
|
||||||
"params" (dict
|
"params" (dict
|
||||||
|
|
@ -5,7 +6,7 @@
|
||||||
"piwikTrackerUrl" site.Params.piwikTrackerUrl
|
"piwikTrackerUrl" site.Params.piwikTrackerUrl
|
||||||
"piwikSiteID" site.Params.piwikSiteID
|
"piwikSiteID" site.Params.piwikSiteID
|
||||||
"plausibleSiteID" site.Params.plausibleSiteID
|
"plausibleSiteID" site.Params.plausibleSiteID
|
||||||
"GoogleAnalytics" site.GoogleAnalytics) -}}
|
"GoogleAnalytics" $gaid) -}}
|
||||||
{{ if eq hugo.Environment "development" -}}
|
{{ if eq hugo.Environment "development" -}}
|
||||||
{{ $opts = merge $opts (dict "minify" false) -}}
|
{{ $opts = merge $opts (dict "minify" false) -}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
@ -19,7 +20,7 @@
|
||||||
<script async defer data-domain="{{ site.Params.plausibleSiteID }}" src="{{ site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
|
<script async defer data-domain="{{ site.Params.plausibleSiteID }}" src="{{ site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
||||||
{{ if site.GoogleAnalytics -}}
|
{{ if $gaid -}}
|
||||||
{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}}
|
{{ $script := resources.Get "js/tracking.js" | js.Build $opts | fingerprint -}}
|
||||||
<script src="{{ $script.RelPermalink }}"></script>
|
<script src="{{ $script.RelPermalink }}"></script>
|
||||||
{{ template "_internal/google_analytics.html" . }}
|
{{ template "_internal/google_analytics.html" . }}
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,11 @@
|
||||||
<description>{{ site.Params.Podcast.Description | default site.Params.Description }}</description>
|
<description>{{ site.Params.Podcast.Description | default site.Params.Description }}</description>
|
||||||
<generator>Hugo -- gohugo.io</generator>
|
<generator>Hugo -- gohugo.io</generator>
|
||||||
<language>{{ site.Params.Podcast.Lang | default site.LanguageCode }}</language>
|
<language>{{ site.Params.Podcast.Lang | default site.LanguageCode }}</language>
|
||||||
{{ with site.Author.email -}}
|
{{ with site.Params.author.email -}}
|
||||||
<managingEditor>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</managingEditor>
|
<managingEditor>{{ . }}{{ with site.Params.author.name }} ({{ . }}){{ end }}</managingEditor>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ with site.Author.email -}}
|
{{ with site.Params.author.email -}}
|
||||||
<webMaster>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</webMaster>
|
<webMaster>{{ . }}{{ with site.Params.author.name }} ({{ . }}){{ end }}</webMaster>
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ with site.Copyright -}}
|
{{ with site.Copyright -}}
|
||||||
<copyright>{{ . }}</copyright>
|
<copyright>{{ . }}</copyright>
|
||||||
|
|
@ -44,9 +44,7 @@
|
||||||
<link>{{ .Permalink }}</link>
|
<link>{{ .Permalink }}</link>
|
||||||
<guid>{{ .Permalink }}</guid>
|
<guid>{{ .Permalink }}</guid>
|
||||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||||
{{ with site.Author.email -}}
|
{{ width site.Params.Podcast.Author }}<author>{{ . }}</author>{{ end }}
|
||||||
<author>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</author>
|
|
||||||
{{ end -}}
|
|
||||||
<description>{{ .Content | html }}</description>
|
<description>{{ .Content | html }}</description>
|
||||||
{{ if site.Params.Podcast.local | default true -}}
|
{{ if site.Params.Podcast.local | default true -}}
|
||||||
{{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (path.Join "/static" .) }}<enclosure url="{{ if site.Params.Podcast.cdn }}{{ path.Join site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}
|
{{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (path.Join "/static" .) }}<enclosure url="{{ if site.Params.Podcast.cdn }}{{ path.Join site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue