refactor: replace deprecated resources.toCss and .Site.Author references

This commit is contained in:
Ben Goldsworthy 2025-01-04 19:45:00 +01:00
parent 1451b66949
commit b07a2a6cf5
Signed by: Rumperuu
SSH key fingerprint: SHA256:e5XfzNOr9UvWpEzyLfw0GtTMZWIFh3NmxH+/qQIi3xE
5 changed files with 11 additions and 11 deletions

View file

@ -29,10 +29,10 @@
<link href="/css/sanitize.css" rel="stylesheet" />
{{- $mainStylesheet := resources.Get "css/main.scss" }}
{{- $mainStylesheet := $mainStylesheet | resources.ToCSS | resources.Fingerprint }}
{{- $mainStylesheet := $mainStylesheet | css.Sass | resources.Fingerprint }}
<link rel="stylesheet" type="text/css" href="{{ $mainStylesheet.Permalink }}" integrity="{{ $mainStylesheet.Data.Integrity | html }}">
{{- $printStylesheet := resources.Get "css/print.scss" }}
{{- $printStylesheet := $printStylesheet | resources.ToCSS | resources.Fingerprint }}
{{- $printStylesheet := $printStylesheet | css.Sass | resources.Fingerprint }}
<link rel="stylesheet" media="print" href="{{ $printStylesheet.Permalink }}" integrity="{{ $printStylesheet.Data.Integrity | html }}">
{{- if .Param "math" -}}
@ -58,7 +58,7 @@
{{- block "footer" . -}}
<footer class="site-footer">
<p>
By <a href="/">{{ $.Site.Author.name }}</a> |
By <a href="/">{{ $.Site.Params.Author.name }}</a> |
<a href="{{ $.Site.Params.codeURL }}{{ $.Site.Params.reportIssueURL }}">Report an Issue</a> |
<a href="{{ relref . "privacy-policy" }}">Privacy Policy</a> |
<a href="/{{ .Sitemap.Filename }}">Sitemap</a> |

View file

@ -17,8 +17,8 @@
<link>{{ .Permalink }}</link>
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
{{ with .Site.LanguageCode }}<language>{{.}}</language>{{end}}
{{ with .Site.Author.email }}<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}
{{ with .Site.Author.email }}<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}
{{ with .Site.Params.Author.email }}<managingEditor>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}
{{ with .Site.Params.Author.email }}<webMaster>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</webMaster>{{end}}
{{ with .Site.Copyright }}<copyright>{{.}}</copyright>{{end}}
{{ if not .Date.IsZero }}<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
{{- with .OutputFormats.Get "RSS" -}}
@ -29,7 +29,7 @@
<title>{{ .Title | plainify }}</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>{{end}}
{{ with .Site.Params.Author.email }}<author>{{.}}{{ with $.Site.Params.Author.name }} ({{.}}){{end}}</author>{{end}}
<guid>{{ .Permalink }}</guid>
<description>{{ .Summary | html }}</description>
</item>

View file

@ -134,15 +134,15 @@
</p>
<ul>
{{- range . -}}
{{- if ( eq . .Site.Author.name ) -}}
<li><p><a class="p-author" itemprop="author" rel="author" href="{{ .Site.Home.Permalink }}">{{ .Site.Author.name }}</a></p></li>
{{- if ( eq . .Site.Params.Author.name ) -}}
<li><p><a class="p-author" itemprop="author" rel="author" href="{{ .Site.Home.Permalink }}">{{ .Site.Params.Author.name }}</a></p></li>
{{- else -}}
<li><p class="p-author" itemprop="author">{{- . -}}</p></li>
{{- end -}}
{{- end -}}
</ul>
{{- else -}}
<a class="p-author" itemprop="author" rel="author" href="{{ .Site.Home.Permalink }}">{{ .Site.Author.name }}</a>
<a class="p-author" itemprop="author" rel="author" href="{{ .Site.Home.Permalink }}">{{ .Site.Params.Author.name }}</a>
{{- end -}}
</p>

View file

@ -1,7 +1,7 @@
{{ "<!--" | safeHTML }}
{{ .Site.Title}} - {{ .Site.Params.tagline }}
This page was created by {{ .Site.Author.name }} <{{ .Site.Author.email }}>.
This page was created by {{ fmt.Printf "%s <%s>" .Site.Params.Author.name .Site.Params.Author.email | safeHTML }}.
The date of creation and last modification should be available within the page
below.

View file

@ -2,7 +2,7 @@
{{ block "header" . }}
<h2 class="p-name site-header__title" itemprop="name"><a class="u-url" href="{{ .Site.Home.RelPermalink }}" rel="me author">{{ .Site.Title }}</a></h2>
<p class="p-note site-header__tagline" itemprop="about">Views my own. Discussion ≠ endorsement. Do try this at home.</p>
<p class="site-header__icons">~ <a class="u-email" href="mailto:{{ $.Site.Author.email }}" rel="me">✉️</a> ~ <a class="u-url" href="{{ .Site.Params.codeURL }}" rel="me">🧑‍💻</a> ~ <a class="u-key" href="/{{ .Site.Params.keyfile }}" rel="me">&#128272;</a> ~ <a href="/index.xml" aria-label="{{ .Site.Title }} RSS feed"><img class="feed-icon" alt="RSS feed" src="{{ .Site.Params.feedIcon }}"></a> ~</p>
<p class="site-header__icons">~ <a class="u-email" href="mailto:{{ $.Site.Params.Author.email }}" rel="me">✉️</a> ~ <a class="u-url" href="{{ .Site.Params.codeURL }}" rel="me">🧑‍💻</a> ~ <a class="u-key" href="/{{ .Site.Params.keyfile }}" rel="me">&#128272;</a> ~ <a href="/index.xml" aria-label="{{ .Site.Title }} RSS feed"><img class="feed-icon" alt="RSS feed" src="{{ .Site.Params.feedIcon }}"></a> ~</p>
<nav class="site-header__nav">
<ul>
{{ range ( where .Site.Sections.ByTitle "Type" "in" site.Params.mainSections ) }}