1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 12:52:10 +00:00

Stop using deprecated functions

- Replace getCSV with resources.Get | transform.Unmarshal. This required
  moving my CSV data to the assets directory, for some reason. Ugh.
- Switch from site.LastChange to site.Lastmod.
This commit is contained in:
Seirdy 2024-07-14 02:08:34 -04:00
parent ca1b9910a1
commit b07f06e009
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
7 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View file

@ -10,7 +10,7 @@ old/
public/ public/
public_*/ public_*/
.hugo_build.lock .hugo_build.lock
csv/webrings.csv assets/csv/webrings.csv
results/ results/
linter-configs/htmltest/ linter-configs/htmltest/
public.eac public.eac

View file

@ -63,7 +63,7 @@
<admin:errorReportsTo xmlns:admin="http://webns.net/mvcb/" rdf:resource="mailto:{{ .Site.Author.email }}" /> <admin:errorReportsTo xmlns:admin="http://webns.net/mvcb/" rdf:resource="mailto:{{ .Site.Author.email }}" />
<rights type="text">Copyright © {{ now.Year }} Rohan Kumar</rights> <rights type="text">Copyright © {{ now.Year }} Rohan Kumar</rights>
<link rel="license" type="application/rdf+xml" href="https://creativecommons.org/licenses/by-sa/4.0/rdf" /> <link rel="license" type="application/rdf+xml" href="https://creativecommons.org/licenses/by-sa/4.0/rdf" />
<updated>{{ site.LastChange.UTC.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated> <updated>{{ site.Lastmod.UTC.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
<generator uri="https://gohugo.io/" version="{{ .Site.Hugo.Version }}">Hugo {{ .Site.Hugo.Version }}</generator> <generator uri="https://gohugo.io/" version="{{ .Site.Hugo.Version }}">Hugo {{ .Site.Hugo.Version }}</generator>
<id>{{ .Permalink }}</id> <id>{{ .Permalink }}</id>
{{ range $pages -}} {{ range $pages -}}

View file

@ -1,5 +1,5 @@
{{- $rewritesDict := dict "" "" -}} {{- $rewritesDict := dict "" "" -}}
{{- range $i, $r := (getCSV "," "/csv/rewrites.csv") -}} {{- range $i, $r := (resources.Get "csv/rewrites.csv" | transform.Unmarshal) -}}
{{- $rewritesDict = merge $rewritesDict (dict (index $r 0) (index $r 1)) -}} {{- $rewritesDict = merge $rewritesDict (dict (index $r 0) (index $r 1)) -}}
{{- end -}} {{- end -}}
{{- return $rewritesDict -}} {{- return $rewritesDict -}}

View file

@ -6,7 +6,7 @@
{{- $refPol = "strict-origin" -}} {{- $refPol = "strict-origin" -}}
{{- end -}} {{- end -}}
<h2 id="webrings">Webrings</h2> <h2 id="webrings">Webrings</h2>
{{ $webringData := after 1 (getCSV "," "/csv/webrings.csv") -}} {{ $webringData := after 1 (resources.Get "csv/webrings.csv" | transform.Unmarshal) -}}
<p>This site is part of {{ len $webringData }} <a href="https://en.wikipedia.org/wiki/Webring">webrings</a>. A webring is a collection of sites in a circular doubly-linked list; each website links to the next and previous site in the list.</p> <p>This site is part of {{ len $webringData }} <a href="https://en.wikipedia.org/wiki/Webring">webrings</a>. A webring is a collection of sites in a circular doubly-linked list; each website links to the next and previous site in the list.</p>
<details> <details>
<summary>Toggle webrings list</summary> <summary>Toggle webrings list</summary>

View file

@ -15,8 +15,8 @@ set -e -u
progname="$(basename "$0")" progname="$(basename "$0")"
dirname="$(dirname "$0")" dirname="$(dirname "$0")"
webrings_src="$dirname/../csv/webrings.base.csv" webrings_src="$dirname/../assets/csv/webrings.base.csv"
webrings_dest="$dirname/../csv/webrings.csv" webrings_dest="$dirname/../assets/csv/webrings.csv"
help_text="Usage: $progname [OPTION...] help_text="Usage: $progname [OPTION...]