diff --git a/Makefile b/Makefile index 0cd3f65..ebf34c7 100644 --- a/Makefile +++ b/Makefile @@ -18,8 +18,6 @@ RSYNCFLAGS_EXTRA ?= # compression gets slow for extreme levels like the old "70109" ECT_LEVEL=9 -VNU ?= vnu - csv/webrings.csv: sh scripts/populate-webrings.sh @@ -60,7 +58,7 @@ validate-json: .PHONY: validate-html validate-html: - $(VNU) --stdout --format json --skip-non-html --also-check-svg $(OUTPUT_DIR) | sh scripts/filter-vnu.sh + sh scripts/vnu.sh $(OUTPUT_DIR) .PHONY: htmlproofer htmlproofer: diff --git a/linter-configs/vnu_filter.jq b/linter-configs/vnu_filter.jq index 95cc119..1262fbc 100644 --- a/linter-configs/vnu_filter.jq +++ b/linter-configs/vnu_filter.jq @@ -21,10 +21,6 @@ ( # see https://github.com/w3c/css-validator/issues/370 .message == "CSS: “contain”: “inline-size” is not a “contain” value." ) - or - ( # the search page has raw templates, let those slide. I validate the final dynamic search page manually. - .url | test ("/search/index.") - ) ) | not ) ) | del(..|select(. == [])) | del(..|select(. == {})) | select(. != null) diff --git a/scripts/vnu.sh b/scripts/vnu.sh new file mode 100644 index 0000000..1c330db --- /dev/null +++ b/scripts/vnu.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e -u +pwd="$(dirname "$0")" +output_dir="$1" + +files_to_analyze() { + find "$output_dir" -type f -name '*.html' -o -name '*.svg' \ + | grep -Ev '(bimi\.svg|search/index\.x?html)$' +} + +# we skip the BIMI icon (VNU can't handle SVG 1.2) and the search page (it has raw templates). +vnu \ + --stdout \ + --format json \ + --also-check-svg \ + $(files_to_analyze) \ + | sh "$pwd/filter-vnu.sh"