Replace .Site.x and $.Site.x with site.x.

This commit is contained in:
Fredrik Jonsson 2021-12-21 18:52:39 +01:00
commit 3737d5874c
21 changed files with 99 additions and 98 deletions

View file

@ -1,9 +1,9 @@
<!DOCTYPE html>
<html class="nojs" lang="{{ .Site.LanguageCode | default .Site.Language.Lang }}" dir="{{ .Site.Language.LanguageDirection | default "ltr" }}">
<html class="nojs" lang="{{ site.LanguageCode | default site.Language.Lang }}" dir="{{ site.Language.LanguageDirection | default "ltr" }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>{{ block "title" . }}{{ .Title }} – {{ .Site.Title }}{{ end }}</title>
<title>{{ block "title" . }}{{ .Title }} – {{ site.Title }}{{ end }}</title>
{{ partial "meta.html" . }}
{{ partialCached "styles.html" . }}
{{- block "head" . }}{{ end }}
@ -12,15 +12,15 @@
{{ partialCached "tracking.html" . }}
</head>
<body class="{{ if .IsPage }}single-page{{ else }}list-page{{ end }}{{ if .IsHome }} front{{ end }}">
<body class="{{ if .IsPage }}single-page{{ else }}list-page{{ end }}{{ if .IsHome }} front{{ end }}{{ with $.Param "bodyclass" }} {{ . }}{{ end }}">
<div class="page layout__page{{ if $.Param "sidebar" | default true }} layout__sidebar-second{{ end }}">
<header class="header layout__header">
{{ if $.Param "logo" | default true }}<a href="{{ "/" | relLangURL }}" title="Home" rel="home" class="header__logo"><img src="{{ with $.Param "logopath" }}{{ . | relURL }}{{ else }}{{ "/images/logo.png" | relURL }}{{ end }}" alt="Home" class="header__logo-image"></a>{{ end }}
<h1 class="header__site-name">
<a href="{{ "/" | relLangURL }}" title="Home" class="header__site-link" rel="home"><span>{{ .Site.Title }}</span></a>
<a href="{{ "/" | relLangURL }}" title="Home" class="header__site-link" rel="home"><span>{{ site.Title }}</span></a>
</h1>
<div class="region header__region">
{{ if .Site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end -}}
{{ if site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end -}}
</div>
</header>
@ -32,7 +32,7 @@
<footer class="footer layout__footer">
{{ if $.Param "feedlinks" }}{{ partial "feedlinks.html" . }}{{ end -}}
<p>{{ with $.Param "copyright" }}{{ . | markdownify }}{{ else }}<span>© {{ .Site.Title }}</span>{{ end }}</p>
<p>{{ with $.Param "copyright" }}{{ . | markdownify }}{{ else }}<span>© {{ site.Title }}</span>{{ end }}</p>
{{ with $.Param "footer" }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a> and the <a href="https://github.com/frjo/hugo-theme-zen">Zen theme</a>.</p>{{ end }}
</footer>

View file

@ -1,20 +1,20 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := $pctx.RegularPages -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- $limit := site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{ $length := (len $pages) -}}
{
"version": "https://jsonfeed.org/version/1.1",
"title": "{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} {{ i18n "string_on" }} {{ end }}{{ .Site.Title }}{{ end }}",
"description": "{{ i18n "string_recent_content" }} {{ if ne .Title .Site.Title }}{{ with .Title }}{{ i18n "string_in" }} {{ . }} {{ end }}{{ end }}{{ i18n "string_on" }} {{ .Site.Title }}",
"home_page_url": "{{ .Site.BaseURL }}",
"title": "{{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} {{ i18n "string_on" }} {{ end }}{{ site.Title }}{{ end }}",
"description": "{{ i18n "string_recent_content" }} {{ if ne .Title site.Title }}{{ with .Title }}{{ i18n "string_in" }} {{ . }} {{ end }}{{ end }}{{ i18n "string_on" }} {{ site.Title }}",
"home_page_url": "{{ site.BaseURL }}",
{{ with .OutputFormats.Get "JSON" -}}
"feed_url": "{{ .Permalink }}",
{{ end -}}
{{ with .Site.LanguageCode -}}
{{ with site.LanguageCode -}}
"language": "{{ . }}",
{{ end -}}
{{ with $.Param "icon" -}}
@ -23,11 +23,11 @@
{{ with $.Param "favicon" -}}
"favicon": "{{ . | absURL }}",
{{ end -}}
{{ with .Site.Author.name -}}
{{ with site.Author.name -}}
"authors": [
{
"name": "{{ . }}"{{ with $.Site.Author.url }},
"url": "{{ . }}"{{ end }}{{ with $.Site.Author.avatar }},
"name": "{{ . }}"{{ with site.Author.url }},
"url": "{{ . }}"{{ end }}{{ with site.Author.avatar }},
"avatar": "{{ . | absURL }}"{{ end }}
}
],

View file

@ -1,27 +1,27 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := $pctx.RegularPages -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- $limit := site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} {{ i18n "string_on" }} {{ end }}{{ .Site.Title }}{{ end }}</title>
<title>{{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} {{ i18n "string_on" }} {{ end }}{{ site.Title }}{{ end }}</title>
<link>{{ .Permalink }}</link>
<description>{{ i18n "string_recent_content" }} {{ if ne .Title .Site.Title }}{{ with .Title }}{{ i18n "string_in" }} {{ . }} {{ end }}{{ end }}{{ i18n "string_on" }} {{ .Site.Title }}</description>
<description>{{ i18n "string_recent_content" }} {{ if ne .Title site.Title }}{{ with .Title }}{{ i18n "string_in" }} {{ . }} {{ end }}{{ end }}{{ i18n "string_on" }} {{ site.Title }}</description>
<generator>Hugo -- gohugo.io</generator>
{{ with .Site.LanguageCode -}}
{{ with site.LanguageCode -}}
<language>{{ . }}</language>
{{ end -}}
{{ with .Site.Author.email -}}
<managingEditor>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{end}}</managingEditor>
{{ with site.Author.email -}}
<managingEditor>{{ . }}{{ with site.Author.name }} ({{ . }}){{end}}</managingEditor>
{{ end -}}
{{ with .Site.Author.email -}}
<webMaster>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{end}}</webMaster>
{{ with site.Author.email -}}
<webMaster>{{ . }}{{ with site.Author.name }} ({{ . }}){{end}}</webMaster>
{{ end -}}
{{ with .Site.Copyright -}}
{{ with site.Copyright -}}
<copyright>{{ . }}</copyright>
{{ end -}}
{{ if not .Date.IsZero -}}
@ -35,8 +35,8 @@
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email -}}
<author>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{end}}</author>
{{ with site.Author.email -}}
<author>{{ . }}{{ with site.Author.name }} ({{ . }}){{end}}</author>
{{ end -}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>

View file

@ -1,5 +1,5 @@
{{- $.Scratch.Add "searchindex" slice -}}
{{- range $index, $element := .Site.RegularPages -}}
{{- range $index, $element := where site.RegularPages "Params.exclude_search" nil -}}
{{- $.Scratch.Add "searchindex" (dict "id" $index "title" $element.Title "permalink" $element.RelPermalink "tags" (delimit ($element.Params.tags | default "") " ") "content" $element.Plain "summary" $element.Summary "date" ($element.Date.Format ($.Param "dateformat" | default "2 January, 2006"))) -}}
{{- end -}}
{{- $.Scratch.Get "searchindex" | jsonify -}}

View file

@ -1,4 +1,4 @@
{{ define "title" }}{{ .Site.Title }}{{ end }}
{{ define "title" }}{{ site.Title }}{{ end }}
{{ define "main" -}}
<main class="main layout__main">
@ -8,7 +8,7 @@
</div>
</article>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ $paginator := .Paginate $pages -}}
{{ range $paginator.Pages -}}
{{ .Render "summary"}}

View file

@ -2,9 +2,9 @@
{{ $length := (len $list) -}}
{
"version" : "https://jsonfeed.org/version/1",
"title" : "Micro posts {{ i18n "string_on" }} {{ .Site.Title }}",
"description": "Micro blog {{ i18n "string_by" }} {{ with $.Site.Author.name }}{{ . }}{{end}}, {{ i18n "string_follow" }} @{{ with $.Param "microusername" }}{{ . }}{{ end }} {{ i18n "string_at" }} https://micro.blog/{{ with $.Param "microusername" }}{{ . }}{{ end }}",
"home_page_url" : "{{ .Site.BaseURL }}",
"title" : "Micro posts {{ i18n "string_on" }} {{ site.Title }}",
"description": "Micro blog {{ i18n "string_by" }} {{ with site.Author.name }}{{ . }}{{end}}, {{ i18n "string_follow" }} @{{ with $.Param "microusername" }}{{ . }}{{ end }} {{ i18n "string_at" }} https://micro.blog/{{ with $.Param "microusername" }}{{ . }}{{ end }}",
"home_page_url" : "{{ site.BaseURL }}",
{{ with .OutputFormats.Get "JSON" -}}
"feed_url" : "{{ .Permalink }}",
{{ end -}}
@ -14,10 +14,10 @@
{{ with $.Param "favicon" -}}
"favicon" : "{{ . | absURL }}",
{{ end -}}
{{ with .Site.Author.name -}}
{{ with site.Author.name -}}
"author" : {
"name" : "{{ . }}"{{ with $.Site.Author.url }},
"url": "{{ . }}"{{ end }}{{ with $.Site.Author.avatar }},
"name" : "{{ . }}"{{ with site.Author.url }},
"url": "{{ . }}"{{ end }}{{ with site.Author.avatar }},
"avatar": "{{ . | absURL }}"{{ end }}
},
{{ end -}}

View file

@ -1,19 +1,19 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Micro posts {{ i18n "string_on" }} {{ .Site.Title }}</title>
<title>Micro posts {{ i18n "string_on" }} {{ site.Title }}</title>
<link>{{ .Permalink }}</link>
<description>Micro blog {{ i18n "string_by" }} {{ with $.Site.Author.name }}{{ . }}{{end}}, {{ i18n "string_follow" }} @{{ with $.Param "microusername" }}{{ . }}{{ end }} {{ i18n "string_at" }} https://micro.blog/{{ with $.Param "microusername" }}{{ . }}{{ end }}</description>
<description>Micro blog {{ i18n "string_by" }} {{ with site.Author.name }}{{ . }}{{end}}, {{ i18n "string_follow" }} @{{ with $.Param "microusername" }}{{ . }}{{ end }} {{ i18n "string_at" }} https://micro.blog/{{ with $.Param "microusername" }}{{ . }}{{ end }}</description>
<generator>Hugo -- gohugo.io</generator>
{{ with .Site.LanguageCode -}}
{{ with site.LanguageCode -}}
<language>{{ . }}</language>
{{ end -}}
{{ with .Site.Author.email -}}
<managingEditor>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{end}}</managingEditor>
{{ with site.Author.email -}}
<managingEditor>{{ . }}{{ with site.Author.name }} ({{ . }}){{end}}</managingEditor>
{{ end -}}
{{ with .Site.Author.email -}}
<webMaster>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{end}}</webMaster>
{{ with site.Author.email -}}
<webMaster>{{ . }}{{ with site.Author.name }} ({{ . }}){{end}}</webMaster>
{{ end -}}
{{ with .Site.Copyright -}}
{{ with site.Copyright -}}
<copyright>{{ . }}</copyright>
{{ end -}}
{{ if not .Date.IsZero -}}

View file

@ -1,7 +1,7 @@
<div class="cookieconsent layout__cookieconsent hidden">
<div class="cookieconsent__message">
{{ i18n "cookieconsent_message" }}
{{ with .Site.Params.privacyPolicyUrl }}<a href="{{ . }}">{{ i18n "privacy_policy" }}</a>{{ end }}
{{ with site.Params.privacyPolicyUrl }}<a href="{{ . }}">{{ i18n "privacy_policy" }}</a>{{ end }}
</div>
<div class="cookieconsent__actions">
<button class="button button--small button--cookieconsent button--decline" type="button" data-consent="false">{{ i18n "cookieconsent_decline" }}</button>

View file

@ -10,8 +10,8 @@
<li><a rel="alternate" href="{{ .RelPermalink }}" hreflang="{{ .Language.Params.LanguageCode | default .Lang }}" lang="{{ .Language.Params.LanguageCode | default .Lang }}">{{ .Language.LanguageName }}</a></li>
{{ end -}}
{{ else -}}
{{ range .Site.Languages -}}
{{ if ne $.Site.Language.Lang .Lang }}
{{ range site.Languages -}}
{{ if ne site.Language.Lang .Lang }}
<li><a rel="alternate" href="{{ .Lang | relURL }}" hreflang="{{ .Params.LanguageCode | default .Lang }}" lang="{{ .Params.LanguageCode | default .Lang }}">{{ .LanguageName }}</a></li>
{{ end -}}
{{ end -}}

View file

@ -1,10 +1,10 @@
<nav class="main-menu layout__navigation">
<h2 class="visually-hidden">{{ i18n "menu_title" }}</h2>
<ul class="navbar">
{{ if .Site.Menus.main -}}
{{ if site.Menus.main -}}
{{ $currentPage := . -}}
{{ range .Site.Menus.main -}}
{{ range site.Menus.main -}}
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a></li>
{{ end -}}
@ -13,11 +13,11 @@
{{ $currentSection := .Section -}}
{{ $currentID := "" -}}
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
{{ with .Site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
{{ range where .Site.RegularPages "Section" "" -}}
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
{{ range where site.RegularPages "Section" "" -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}
{{ range .Site.Sections -}}
{{ range site.Sections -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}

View file

@ -6,7 +6,7 @@
<meta name="modified" {{ printf "content=%q" (.Lastmod.Format "2006-01-02T15:04:05-0700") | safeHTMLAttr }}>
{{ with $.Param "author" }}<meta name="author" content="{{ . }}">{{ end }}
{{ with $.Param "contact" }}<meta name="contact" content="{{ . }}">{{ end }}
<meta property="og:site_name" content="{{ .Site.Title }}">
<meta property="og:site_name" content="{{ site.Title }}">
<meta property="og:title" content="{{ .Title }}">
<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}">
@ -14,7 +14,7 @@
{{ hugo.Generator }}
<meta name="msapplication-TileColor" content="{{ $.Param "themecolor" | default "#ffffff" }}">
<meta name="theme-color" content="{{ $.Param "themecolor" | default "#ffffff" }}">
{{ with .Site.Params.piwikTrackerUrl }}<link rel="dns-prefetch" href="https://{{ . }}">{{ end }}
{{ with site.Params.piwikTrackerUrl }}<link rel="dns-prefetch" href="https://{{ . }}">{{ end }}
{{ with $.Param "microusername" }}<link rel="me" href="https://micro.blog/{{ . }}">{{ end }}
<link rel="canonical" href="{{ .Permalink }}">
{{ if .IsTranslated -}}

View file

@ -30,18 +30,18 @@
{{ end -}}
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{ .Site.BaseURL }}
"@id": {{ site.BaseURL }}
},
"publisher": {
"@type": "Organization",
"name": {{ .Site.Title }},
"name": {{ site.Title }},
{{ with $.Param "icon" -}}
"logo" : {
"@type": "ImageObject",
"url": {{ . | absURL }}
},
{{ end -}}
"url": {{ .Site.BaseURL }}
"url": {{ site.BaseURL }}
}
}
</script>

View file

@ -3,15 +3,15 @@
<a href="#navigation" class="mobile-nav__toggle" aria-haspopup="true" role="button">{{ i18n "menu_mobile" }}</a>
<div class="mobile-nav__sheet">
<div class="mobile-nav__region">
{{ if .Site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end }}
{{ if site.IsMultiLingual }}{{ partial "language-selector.html" . }}{{ end }}
</div>
<nav class="mobile-nav__main-menu">
<h2 class="visually-hidden">{{ i18n "menu_title" }}</h2>
<ul class="mobile-nav__navbar">
{{ if .Site.Menus.main -}}
{{ if site.Menus.main -}}
{{ $currentPage := . -}}
{{ range .Site.Menus.main -}}
{{ range site.Menus.main -}}
<li><a href="{{ .URL | relLangURL }}"{{ if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} class="active" aria-current="page"{{ end }}>{{ .Name }}</a></li>
{{ end -}}
@ -20,11 +20,11 @@
{{ $currentSection := .Section -}}
{{ $currentID := "" -}}
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
{{ with .Site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
{{ range where .Site.RegularPages "Section" "" -}}
{{ with site.Home }}<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ i18n "menu_home" }}</a></li>{{ end }}
{{ range where site.RegularPages "Section" "" -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentID .File.UniqueID }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}
{{ range .Site.Sections -}}
{{ range site.Sections -}}
<li><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></li>
{{ end -}}

View file

@ -1,9 +1,9 @@
{{ $src := (.Params.podcast.mp3 | absURL) -}}
{{ if .Site.Params.Podcast.cdn -}}
{{ $src = add $.Site.Params.Podcast.cdn (.Params.podcast.mp3 | relURL) -}}
{{ if site.Params.Podcast.cdn -}}
{{ $src = add site.Params.Podcast.cdn (.Params.podcast.mp3 | relURL) -}}
{{ end -}}
<figure class="podcast">
<audio controls preload="{{ .Site.Params.Podcast.preload | default "metadata" }}"><source src="{{ $src }}" type="audio/mpeg"></audio>
<audio controls preload="{{ site.Params.Podcast.preload | default "metadata" }}"><source src="{{ $src }}" type="audio/mpeg"></audio>
<figcaption><a href="{{ $src }}">{{ .Title }}</a></figcaption>
</figure>
{{ with .Params.podcast.image }}

View file

@ -1,5 +1,5 @@
<aside class="related layout__related">
{{ $related := .Site.RegularPages.Related . | first 3 -}}
{{ $related := site.RegularPages.Related . | first 3 -}}
{{ with $related -}}
<h2>{{ i18n "string_see_also" }}</h2>
<ul>

View file

@ -2,7 +2,7 @@
{{ $currentID := "" -}}
{{ with .File }}{{ $currentID = .UniqueID }}{{ end -}}
<aside class="sidebar layout__second-sidebar">
{{ range .Site.Sections -}}
{{ range site.Sections -}}
<section>
<h4 class="menu"><a href="{{ .RelPermalink }}"{{ if eq $currentSection .Section }} class="active" aria-current="page"{{ end }}>{{ .Title }}</a></h4>
<ul class="menu">

View file

@ -1,14 +1,14 @@
{{ if and .Site.Params.piwikTrackerUrl .Site.Params.piwikSiteID -}}
{{ if and site.Params.piwikTrackerUrl site.Params.piwikSiteID -}}
{{ $script := resources.Get "js/tracking.js" | resources.ExecuteAsTemplate "js/tracking.js" . | minify | fingerprint -}}
<script src="{{ $script.RelPermalink }}"></script>
<script defer src="https://{{ .Site.Params.piwikTrackerUrl }}/matomo.js"></script>
<script defer src="https://{{ site.Params.piwikTrackerUrl }}/matomo.js"></script>
{{ end -}}
{{ if .Site.Params.plausibleSiteID -}}
<script async defer data-domain="{{ .Site.Params.plausibleSiteID }}" src="{{ .Site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
{{ if site.Params.plausibleSiteID -}}
<script async defer data-domain="{{ site.Params.plausibleSiteID }}" src="{{ site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
{{ end -}}
{{ if .Site.GoogleAnalytics -}}
{{ if site.GoogleAnalytics -}}
{{ $script := resources.Get "js/tracking.js" | resources.ExecuteAsTemplate "js/tracking.js" . | minify | fingerprint -}}
<script src="{{ $script.RelPermalink }}"></script>
{{ template "_internal/google_analytics.html" . }}

View file

@ -1,17 +1,17 @@
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>{{ .Site.Params.Podcast.Title | default .Site.Title }}</title>
<title>{{ site.Params.Podcast.Title | default site.Title }}</title>
<link>{{ .Permalink }}</link>
<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>
<language>{{ .Site.Params.Podcast.Lang | default .Site.LanguageCode }}</language>
{{ with .Site.Author.email -}}
<managingEditor>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{end}}</managingEditor>
<language>{{ site.Params.Podcast.Lang | default site.LanguageCode }}</language>
{{ with site.Author.email -}}
<managingEditor>{{ . }}{{ with site.Author.name }} ({{ . }}){{end}}</managingEditor>
{{ end -}}
{{ with .Site.Author.email -}}
<webMaster>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{end}}</webMaster>
{{ with site.Author.email -}}
<webMaster>{{ . }}{{ with site.Author.name }} ({{ . }}){{end}}</webMaster>
{{ end -}}
{{ with .Site.Copyright -}}
{{ with site.Copyright -}}
<copyright>{{ . }}</copyright>
{{ end -}}
{{ if not .Date.IsZero -}}
@ -20,25 +20,25 @@
{{ with .OutputFormats.Get "RSS" -}}
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{ end -}}
{{ with .Site.Params.Podcast.Image }}{{ $image := resources.Get . }}<itunes:image href="{{ $image.Permalink }}" />{{ end }}
{{ with .Site.Params.Podcast.Category -}}
{{ with site.Params.Podcast.Image }}{{ $image := resources.Get . }}<itunes:image href="{{ $image.Permalink }}" />{{ end }}
{{ with site.Params.Podcast.Category -}}
<itunes:category {{ if .name }}text="{{ .name }}"{{end}}>
{{ range .subcategories }}<itunes:category text="{{ . }}" />{{ end }}
</itunes:category>
{{ end -}}
{{ with .Site.Params.Podcast.Owner -}}
{{ with site.Params.Podcast.Owner -}}
<itunes:owner>
{{ with .name }}<itunes:name>{{ . }}</itunes:name>{{ end }}
{{ with .email }}<itunes:email>{{ . }}</itunes:email>{{ end }}
</itunes:owner>
{{ end -}}
{{ with .Site.Params.Podcast.Description }}<itunes:summary>{{ . }}</itunes:summary>{{ end }}
{{ with .Site.Params.Podcast.Author }}<itunes:author>{{ . }}</itunes:author>{{ end }}
{{ with .Site.Params.Podcast.Type }}<itunes:type>{{ . }}</itunes:type>{{ end }}
{{ with .Site.Params.Podcast.Block }}<itunes:block>{{ . }}</itunes:block>{{ end }}
{{ with .Site.Params.Podcast.Complete }}<itunes:complete>{{ . }}</itunes:complete>{{ end }}
{{ with .Site.Params.Podcast.NewFeed }}<itunes:new-feed-url>{{ . }}</itunes:new-feed-url>{{ end }}
<itunes:explicit>{{ if .Site.Params.Podcast.Explicit }}true{{ else }}false{{ end }}</itunes:explicit>
{{ with site.Params.Podcast.Description }}<itunes:summary>{{ . }}</itunes:summary>{{ end }}
{{ with site.Params.Podcast.Author }}<itunes:author>{{ . }}</itunes:author>{{ end }}
{{ with site.Params.Podcast.Type }}<itunes:type>{{ . }}</itunes:type>{{ end }}
{{ with site.Params.Podcast.Block }}<itunes:block>{{ . }}</itunes:block>{{ end }}
{{ with site.Params.Podcast.Complete }}<itunes:complete>{{ . }}</itunes:complete>{{ end }}
{{ with site.Params.Podcast.NewFeed }}<itunes:new-feed-url>{{ . }}</itunes:new-feed-url>{{ end }}
<itunes:explicit>{{ if site.Params.Podcast.Explicit }}true{{ else }}false{{ end }}</itunes:explicit>
{{ range .Pages }}
<item>
<title>{{ .Title }}</title>
@ -46,14 +46,14 @@
<link>{{ .Permalink }}</link>
<guid>{{ .Permalink }}</guid>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
{{ with .Site.Author.email -}}
<author>{{ . }}{{ with $.Site.Author.name }} ({{ . }}){{ end }}</author>
{{ with site.Author.email -}}
<author>{{ . }}{{ with site.Author.name }} ({{ . }}){{ end }}</author>
{{ end -}}
<description>{{ .Content | html }}</description>
{{ if $.Site.Params.Podcast.local | default true -}}
{{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (add "/static" (. | relURL)) }}<enclosure url="{{ if $.Site.Params.Podcast.cdn }}{{ add $.Site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}
{{ if site.Params.Podcast.local | default true -}}
{{ with .Params.podcast.mp3 }}{{ $file_stat := os.Stat (add "/static" (. | relURL)) }}<enclosure url="{{ if site.Params.Podcast.cdn }}{{ add site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" length="{{ $file_stat.Size }}" type="audio/mpeg" />{{ end }}
{{ else -}}
{{ with .Params.podcast.mp3 }}<enclosure url="{{ if $.Site.Params.Podcast.cdn }}{{ add $.Site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" type="audio/mpeg" />{{ end }}
{{ with .Params.podcast.mp3 }}<enclosure url="{{ if site.Params.Podcast.cdn }}{{ add site.Params.Podcast.cdn (. | relURL) }}{{ else }}{{ . | absURL }}{{ end }}" type="audio/mpeg" />{{ end }}
{{ end -}}
{{ with .Params.podcast.duration }}<itunes:duration>{{ . }}</itunes:duration>{{ end }}
{{ with .Params.podcast.image.src }}{{ $image := resources.Get . }}<itunes:image href="{{ $image.Permalink }}" />{{ end }}

View file

@ -11,7 +11,7 @@
{{ $srcsetw := (slice) }}
{{ $title := .Get "title" -}}
{{ $width := .Get "width" -}}
{{ $maxwidth := .Site.Params.imageMaxWidth -}}
{{ $maxwidth := site.Params.imageMaxWidth -}}
{{ $realwidth := 0 -}}
{{ $realheight := 0 -}}
{{ if and $src (fileExists (add "/assets" $src)) -}}

View file

@ -7,7 +7,7 @@
{{ $srcset := .Get "srcset" -}}
{{ $srcsetw := (slice) }}
{{ $width := .Get "width" -}}
{{ $maxwidth := .Site.Params.imageMaxWidth -}}
{{ $maxwidth := site.Params.imageMaxWidth -}}
{{ $realwidth := 0 -}}
{{ $realheight := 0 -}}
{{ if and $src (fileExists (add "/assets" $src)) -}}

Some files were not shown because too many files have changed in this diff Show more