1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02:09 +00:00

Compare commits

..

5 commits

Author SHA1 Message Date
Seirdy
b07f06e009
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.
2024-07-14 02:08:34 -04:00
Seirdy
ca1b9910a1
Document fflint 2024-07-14 01:52:02 -04:00
Seirdy
566539df67
make alt attr use double quotes 2024-07-14 01:49:20 -04:00
Seirdy
5a4da5f818
Add fflint checks
See https://www.fflint.dev/ and https://github.com/FileFormatInfo/fflint
2024-07-14 01:42:04 -04:00
Seirdy
df5516a476
Add IndieWeb IWC badge 2024-07-13 23:39:39 -04:00
13 changed files with 37 additions and 12 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

@ -97,10 +97,14 @@ html-validate:
.validate-feed-notes:
scripts/bin/validate-feed file://$(PWD)/$(OUTPUT_DIR)/notes/atom.xml
validate-feeds: .validate-feed-main .validate-feed-posts .validate-feed-notes
.PHONY: validate-feeds .validate-feed-main .validate-feed-posts .validate-feed-notes
fflint: hugo
sh scripts/fflint.sh $(OUTPUT_DIR)
.PHONY: validate-feeds .validate-feed-main .validate-feed-posts .validate-feed-notes fflint
.PHONY: lint-local
lint-local: html-validate validate-html validate-json htmlproofer validate-feeds
lint-local: fflint htmlproofer validate-feeds validate-json html-validate validate-html
# dev server, includes future and draft posts
.PHONY: serve
@ -195,5 +199,5 @@ lint-and-deploy-staging:
deploy-envs:
@$(MAKE) HUGO_FLAGS='--gc --ignoreCache' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs xhtmlize
@$(MAKE) HUGO_FLAGS='--gc --ignoreCache' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs copy-to-xhtml
@$(MAKE) HUGO_FLAGS='' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs validate-html html-validate validate-json validate-feeds
@$(MAKE) HUGO_FLAGS='' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs fflint validate-json validate-feeds validate-html html-validate
@$(MAKE) SSHFLAGS='-o KexAlgorithms=curve25519-sha256@libssh.org' HUGO_FLAGS='' USER=seirdy@envs.net WWW_ROOT=/home/seirdy/public_html GEMINI_ROOT=/home/seirdy/public_gemini HUGO_BASEURL='https://envs.net/~seirdy/' OUTPUT_DIR=public_envs deploy

BIN
assets/p/b/indieweb.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

View file

@ -41,7 +41,7 @@ Template markup to embed my 88x31 badge.
- Double the width and height in your HTML to `width="176" height="62"` to make them easier to read on higher-resolution screens.
- The more consecutive badges you have, the shorter your alt-text should be. Balance the need for detail against the need to skim.
- The more consecutive badges you have, the shorter your average alt-text should be. Balance the need for detail against the need to skim.
- If you want to detect my button programmatically, consider the [`.well-known/button.json` schema](https://codeberg.org/LunarEclipse/well-known-button).
@ -80,6 +80,7 @@ Read more about the design of this site in my [site design standards page]({{<re
<a href="https://www.mabsland.com/Adoption.html">{{<picture name="b/panda_14c" alt="Smug panda fursona next to the text “Web 14”." width="176" height="62" class="pix">}}</a>
<a href="https://tildeverse.org/">{{<picture name="b/tildeverse" alt="Tildeverse." width="176" height="62" class="pix">}}</a>
<a href="https://indieweb.org/">{{<picture name="b/indieweb" alt="I W C Now! indieweb.org." width="176" height="62" class="pix">}}</a>
<a href="https://indieweb.org/Webmention">{{<picture name="b/webmentions" alt="Webmentions supported." width="176" height="62" class="pix">}}</a>
<a href="https://internet.nl/faqs/ipv6/">{{<picture name="b/ipv6" alt="The word “IPv6” next to a green checkmark." width="176" height="62" class="pix">}}</a>
<a href="https://creativecommons.org/licenses/by-sa/4.0/">{{<picture name="b/cc-by-sa" alt="Creative Commons BY-SA license." width="176" height="62" class="pix">}}</a>

View file

@ -59,6 +59,8 @@ Other lints/checks I run also use additional command-line utilities such as `sd`
#### Quick linters
- [fflint](https://www.fflint.dev/)
- Stylelint
- [html-validate](https://html-validate.org/)

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

@ -12,7 +12,7 @@
{{ $dark_webp := resources.GetMatch (printf "/p/%s_dark.webp" (.Get "name")) -}}
{{ $dark_avif := resources.GetMatch (printf "/p/%s_dark.avif" (.Get "name")) -}}
{{ $dark_jxl := resources.GetMatch (printf "/p/%s_dark.jxl" (.Get "name")) -}}
{{ $alt := .Get "alt" -}}
{{- $orig_img := $light_png -}}
{{- $orig_img_type := "image/png" -}}
{{- $orig_img_dark := $dark_png -}}
@ -119,7 +119,7 @@
type="{{ $orig_img_type }}" />
<img{{ with .Get "class" }} class="{{ . }}"{{ end }}
width="{{ $img_width }}" height="{{ $img_height }}"
src="{{ $orig_src.Permalink }}" alt='{{ .Get "alt" }}'
src="{{ $orig_src.Permalink }}" alt="{{ $alt }}"
{{ with .Parent -}}
{{ if eq .Name "transcribed-image-figure" -}}
{{ with .Get "id" -}}

18
scripts/fflint.sh Normal file
View file

@ -0,0 +1,18 @@
#!/bin/sh
#fflint json --show-tests all --show-detail "$output_dir/**/*.json"
set -e -u
output_dir="$1"
fflint_wrapper() {
fflint --fail-fast --progress=false --show-tests failing $*
}
cd "$output_dir"
find '.' -type f -name "*.jpg" | fflint_wrapper --height 1-1500 --width 1-1500 jpeg @-
find '.' -type f -name "*.png" | fflint_wrapper --height 1-1500 --width 1-1500 png @-
find '.' -type f -name "*.json" -o -name ".webmanifest" | fflint_wrapper json @-
find '.' -type f -name "*.html" | fflint_wrapper html @-
find '.' -type f -name "*.svg" | fflint_wrapper --height 1-1500 --width 1-1500 svg @-
find '.' -type f -name "*.txt" -o -name "*.gmi" -o -name "*.asc" | fflint_wrapper text @-
find '.' -type f -name "*.xhtml" -o -name "*.xml" | fflint_wrapper xml @-

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...]