1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-19 11:52:11 +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_*/
.hugo_build.lock
csv/webrings.csv
assets/csv/webrings.csv
results/
linter-configs/htmltest/
public.eac

View file

@ -63,7 +63,7 @@
<admin:errorReportsTo xmlns:admin="http://webns.net/mvcb/" rdf:resource="mailto:{{ .Site.Author.email }}" />
<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" />
<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>
<id>{{ .Permalink }}</id>
{{ range $pages -}}

View file

@ -1,5 +1,5 @@
{{- $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)) -}}
{{- end -}}
{{- return $rewritesDict -}}

View file

@ -6,7 +6,7 @@
{{- $refPol = "strict-origin" -}}
{{- end -}}
<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>
<details>
<summary>Toggle webrings list</summary>

View file

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