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

Compare commits

...

5 commits

Author SHA1 Message Date
Rohan Kumar
c0904f3b32
Moar site testing
- Replace achecker flags with a config file
- Bring back webhint
- Amend check-whole-site so that it will deploy to staging if all checks
  pass, and then run webhint on every staging page.
2022-07-17 20:01:54 -07:00
Rohan Kumar
cd8d0e88ae
Webmentions: don't use a <dl> for no mentions
When I have no webmentions, I shouldn't use a <dl> to describe the
menchie placeholder.
2022-07-17 19:25:38 -07:00
Rohan Kumar
0480b60aad
Reduce length of some names 2022-07-17 19:19:07 -07:00
Rohan Kumar
a2c919ca2e
Remove one extra indent level
We don't need to indent children of <body> or <head> since the element
type will give away the parent.
2022-07-17 19:18:22 -07:00
Rohan Kumar
f99c153f72
missing abbr title 2022-07-17 19:14:34 -07:00
14 changed files with 122 additions and 34 deletions

44
.achecker.yml Normal file
View file

@ -0,0 +1,44 @@
# optional - Specify the rule archive
# i.e. For march rule archive use ruleArchive: 2017MayDeploy
# Default: latest
# Refer to README.md FAQ section below to get the rule archive ID.
ruleArchive: preview
# optional - Specify one or many policies to scan.
# i.e. For one policy use policies: IBM_Accessibility_2017_02
# i.e. Multiple policies: IBM_Accessibility_2017_02,IBM_Accessibility_BETA or refer to below as a list
# Default: null (all policies)
# Refer to README.md FAQ section below to get the policy ID.
policies:
- IBM_Accessibility
- WCAG_2_1
- WCAG_2_0
# optional - Specify one or many violation levels on which to fail the test
# i.e. If specified violation then the testcase will only fail if
# a violation is found during the scan.
# i.e. failLevels: violation
# i.e. failLevels: violation,potential violation or refer to below as a list
# Default: violation, potentialviolation
failLevels:
- violation
- recommendation
# optional - Specify one or many violation levels which should be reported
# i.e. If specified violation then in the report it would only contain
# results which are level of violation.
# i.e. reportLevels: violation
# i.e. reportLevels: violation,potentialviolation or refer to below as a list
# Default: violation, potentialviolation, recommendation, potentialrecommendation, manual
reportLevels:
- violation
- potentialviolation
- recommendation
- potentialrecommendation
- manual
# - pass
# Optional - In what format types the results should be output in (json, html)
# Default: json
outputFormat:
- json

1
.gitignore vendored
View file

@ -13,3 +13,4 @@ public_*/
csv/webrings.csv
results/
linter-configs/htmltest/
public.eac

View file

@ -43,6 +43,15 @@ lint-css: $(CSS_DIR)/*.css
pnpm -s dlx stylelint --config linter-configs/stylelintrc.json --di --rd --rdd $(CSS_DIR)/*.css
@#csslint --quiet $(CSS_DIR)
# IBM Equal Access Accessibility Checker can't handle content-visibility,
# so run it on a special version of the site without content-visibility.
.PHONY: equal-access
equal-access:
cp -r $(OUTPUT_DIR) $(OUTPUT_DIR).eac
find $(OUTPUT_DIR).eac -type f -name "*.html" | xargs -n1 sd 'content-visibility:auto;' ''
achecker $(OUTPUT_DIR).eac/
rm -rf $(OUTPUT_DIR).eac
.PHONY: validate-json
validate-json:
jq -reM '""' $(OUTPUT_DIR)/manifest.min.*.webmanifest 1>/dev/null

View file

@ -17,7 +17,7 @@ CPU_SLOWDOWN=2.8
LIGHTHOUSE_ARGS += --view --budget-path linter-configs/budget.json --output html --output json --output-file lighthouse-results --throttling.cpuSlowdownMultiplier=$(CPU_SLOWDOWN) --chrome-flags="$(CHROME_FLAGS)"
hint-online:
hint --config linter-configs/hintrc -f codeframe $(URL)
hint --config linter-configs/hintrc $(URLS)
lighthouse:
mkdir -p $(CHROME_PROFILE)
CHROME_PATH=$(CHROME_PATH) CHROME_PROFILE=$(CHROME_PROFILE) JS_FLAGS='' lighthouse $(URLS) $(LIGHTHOUSE_ARGS)
@ -30,11 +30,7 @@ axe:
axe $(URLS) --chrome-options $(CHROME_FLAGS_COMMA) --chromedriver-path=$(CHROMEDRIVER_PATH) --show-errors
axe-ff:
PATH=scripts/bin:$(PATH) axe $(URLS) -b firefox --show-errors
equal-access:
@echo $(URLS) | tr ' ' '\n' >urls.txt
achecker --reportLevels violation,recommendation,potentialrecommendation urls.txt
rm urls.txt
.PHONY: axe axe-ff equal-access
.PHONY: axe axe-ff
.validate-feed-main:
scripts/bin/validate-feed $(HUGO_BASEURL)atom.xml

View file

@ -20,7 +20,7 @@ Age
: 22
Location
: <span class="p-region">California</span>, <abbr itemprop="nationality" itemscope="" itemtype="https://schema.org/Country" class="p-country-name">USA</abbr>
: <span class="p-region">California</span>, <abbr itemprop="nationality" itemscope="" itemtype="https://schema.org/Country" class="p-country-name" title="United States of America">USA</abbr>
Gender
: <span class="p-gender-identity" itemprop="gender">Male</span>

View file

@ -59,10 +59,13 @@ Finally, I supplement manual testing with the following automated tools:
- [AInspector](https://github.com/ainspector/ainspector-for-firefox)
- [WAVE Web Accessibility Evaluation Tool](https://wave.webaim.org/)
- [ARC Toolkit](https://www.tpgi.com/arc-platform/arc-toolkit/)
- [webhint](https://webhint.io/)
WAVE reports no errors; AXE is unable to determine certain contrast errors, but it otherwise reports no errors; IBM Equal Access reports no errors but some items that need review.
I regularly run axe-core and the IBM Equal Access Accessibility Checker on every page in my sitemap, and receive no errors.
I regularly run axe-core, the IBM Equal Access Accessibility Checker, the Nu HTML Checker (local build, latest commit), and webhint on every page in my sitemap. After filtering out false-positives (and reporting them upstream), I receive no errors.
Due to [issue 1008 in IBM Equal Access Checker](https://github.com/IBMa/equal-access/issues/1008), I remove all instances of `content-visibility` from my site's CSS before running `achecker` from the command line.
Compatibility statement
-----------------------

View file

@ -2,7 +2,7 @@
title: "Minimal website responsiveness"
date: 2022-06-11T13:00:26-07:00
replyURI: "https://social.treehouse.systems/@ayushnix/108460135741971671"
replyTitle: "Can anyone explain why someone would want to scale font size using multiple media query breakpoints using different device widths or by using fluid typography?"
replyTitle: "Im unable to understand why [scaling font size] would be required"
replyType: "SocialMediaPosting"
replyAuthor: "Ayush Agarwal"
replyAuthorURI: "https://microblog.ayushnix.com/"

View file

@ -2,6 +2,7 @@
date: "2021-01-23T12:21:38-08:00"
keywords: intern, python, golang, go, lua, moonscript, shell, bash, zsh, posix, java, haskell, C, influxdb, influxdata, chronograf, grafana, kapacitor, numpy, scipy, pandas, jupyter, docker, podman, buildah, skopeo, kubernetes, openshift, cloud native, physics, jenkins, git, gitlab, github, linux, bsd, red hat, fedora, debian, ubuntu, opensuse, suse
title: Rohan Kumar
description: "Detail-oriented, committed, self-motivated, OSS enthusiast proficient in Python, Go, Linux/UNIX systems, and cloud-native computing looking for an internship."
disableMeta: true
---
[https://seirdy<wbr />.one](https://seirdy.one/) | [seirdy<wbr />@seirdy.one](mailto:seirdy@seirdy.one)

View file

@ -4,15 +4,19 @@
<h2 id="webmentions" tabindex="-1">Web&#173;mentions</h2>
<p>This site supports <a href="https://indieweb.org/webmention">Webmentions</a>, a backlink-based alternative to traditional comment forms.</p>
{{ partial "webmention-form.html" . }}
<p>Webmentions received for this post will appear in the following list after I approve them. I sometimes send Webmentions to myself on behalf of linking sites that don't support them. Check the <a href="https://web.archive.org/">Wayback Machine</a> if any links are broken.</p>
{{- $target := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
{{ $url1 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}}
{{ $webmentions := (getJSON $url1) -}}
{{- if lt .Date.Unix 1653616670 -}}{{- /* commit c84c8d4 changed my URL schemes, so fetch menchies for the legacy scheme on old posts. */ -}}
{{- $oldTarget := $target | replaceRE "/posts" "" | replaceRE "/$" ".html" -}}
{{- $url2 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $oldTarget -}}
{{- $webmentions = $webmentions | append (getJSON $url2) -}}
{{- end -}}
{{- if gt (len $webmentions) 0 -}}
<p>Webmentions received for this post appear in the following list after I approve them. I sometimes send Webmentions to myself on behalf of linking sites that don't support them. I replace broken links with <a href="https://web.archive.org/">Wayback Machine</a> snapshots, if they exist.</p>
<details>
<summary>Toggle Webmentions</summary>
<dl>
{{- $target := .RelPermalink | replaceRE "^/~seirdy/" "/" }}
{{- $oldTarget := $target | replaceRE "/posts" "" | replaceRE "/$" ".html" -}}
{{ $url1 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $target -}}
{{ $url2 := printf "https://seirdy.one/webmentions/get?status=approved&target=https://seirdy.one%s" $oldTarget -}}
{{ $webmentions := (getJSON $url1) | append (getJSON $url2) -}}
{{ range sort $webmentions "created_at" -}}
{{ $webmention := . -}}
{{- /* Boolean: should we should handle this webmention like a comment or a linkback? */ -}}
@ -74,16 +78,16 @@
{{- if findRE `^https://brid.gy/[^/]*/mastodon` $webmention.source -}}
<p role="doc-tip" itemprop="accessibilitySummary">This comment may have major formatting errors that could impact screen reader comprehension.</p>
{{- end -}}
<p itemprop="articleBody" class="p-content">{{ $webmention.content | replaceRE `^@Seirdy(@pleroma.envs.net)? ?` ""}}</p>
<p><q itemprop="articleBody" class="p-content">{{ $webmention.content | replaceRE `^@Seirdy(@pleroma.envs.net)? ?` ""}}</q></p>
{{- end -}}
{{- end }}
</dd>
</div>
{{ else -}}
<dt>Nothing here</dt>
<dd>This post does not have any approved Webmentions yet.</dd>
{{- end }}
{{- end -}}
</dl>
</details>
{{ else -}}
<p>This post does not have any approved Webmentions yet.</p>
{{- end }}
<p>Feel free to contact me directly with feedback; <a href="{{ .Site.BaseURL }}about/#location-seirdy-online">heres my contact info</a></p>
</section>

View file

@ -19,7 +19,12 @@
"error",
{
"ignore": [
"filter"
"filter",
"contain",
"image-rendering: pixelated",
"contain-intrinsic-size",
"content-visibility",
"text-size-adjust"
]
}
],
@ -30,27 +35,51 @@
"time",
"picture",
"meta[name=color-scheme]",
"img[decoding]"
"meta[name=theme-color]",
"img[decoding]",
"a[referrerpolicy]",
"code[translate]",
"a[translate]",
"span[translate]",
"samp[translate]"
]
}
],
"doctype": "error",
"highest-available-document-mode": "off",
"http-cache": [
"error",
{
"maxAgeTarget": 300
"maxAgeTarget": 600
}
],
"http-compression": "off",
"https-only": "error",
"manifest-file-extension": "error",
"manifest-is-valid": "error",
"meta-viewport": "error",
"no-bom": "error",
"no-p3p": "error",
"html-checker": "off",
"content-type": ["error", {
".*\\.svg": "image/svg+xml"
}],
"no-html-only-headers": [ "warning",
{
"ignore": ["content-security-policy"]
}],
"performance-budget": [
"error",
{
"connectionType": "3GSlow",
"loadTime": 5
"loadTime": 10
}
],
"stylesheet-limits": [
"error",
{
"maxRules": 100,
"maxSheets": 2,
"maxImports": 0
}
],
"ssllabs": "off"

View file

@ -1,14 +1,12 @@
{
"devDependencies": {
"@hint/formatter-codeframe": "^3.1.22",
"@hint/hint-doctype": "^3.3.10",
"@hint/hint-https-only": "^2.4.10",
"@hint/hint-performance-budget": "^2.4.10",
"hint": "^6.1.4",
"@hint/hint-doctype": "^3.3.20",
"hint": "^7.1.0",
"stylelint": "^14.8.1",
"stylelint-config-standard": "^25.0.0"
},
"dependencies": {
"stylelint-config-recommended": "^7.0.0"
"stylelint-config-recommended": "^7.0.0",
"typescript": ">=2.8.0"
}
}

View file

@ -62,5 +62,8 @@ base_url="${1-http://localhost:8089}"
# HTML validation is already parallelized, so run that single-threaded.
make -j1 HUGO_FLAGS=-DF HUGO_BASEURL="$base_url" clean hugo xhtmlize validate-html
make -j "$jobs" -f Makefile.online HUGO_BASEURL="$base_url" all-extra URLS="$(curl -sSL "$base_url/sitemap.xml" | htmlq loc -t | rg -v '/search/$' | tr '\n' ' ')"
make deploy-staging
make -f Makefile.online hint-online URLS="$(curl -sSL --compressed https://staging.seirdy.one/sitemap.xml | htmlq loc -t | rg -v '/search/$' | sort | tr '\n' ' ')"
# TODO: run lighthouse on every page in the sitemap.
# vi:ft=sh

View file

@ -25,8 +25,8 @@ cleanup() {
trap cleanup EXIT
# delete the stylesheet from the html file; we'll re-insert it later.
# Also remove one indentation level
sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | sd '^\t' '' >"$tmp_file"
# Also remove two indentation levels
sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | sd '^\t(?:\t)?' '' >"$tmp_file"
{
head -n7 "$tmp_file" | sd -s '/>' ' />'
cat tmp.css

View file

@ -8,7 +8,7 @@ set -e -u
output_dir="$1"
script_dir="$(dirname "$0")"
printf '\t<style>%s</style>\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css
printf '<style>%s</style>\n' "$(htmlq -t style <"$output_dir/index.html")" >tmp.css
cleanup() {
rm -f "tmp.css"
}