aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2025-05-12 16:36:38 -0400
committerPaul Duncan <pabs@pablotron.org>2025-05-12 16:36:38 -0400
commitfbb8548c3cab2b581f28d869843bf87bd805f4b9 (patch)
tree43d35f4fec9953e439b8c3a6000d4f39c8b725d7
parentdcf573e2330fd71152cf845989bd5f3ec8f6d40e (diff)
downloadpablotron.org-fbb8548c3cab2b581f28d869843bf87bd805f4b9.tar.xz
pablotron.org-fbb8548c3cab2b581f28d869843bf87bd805f4b9.zip
README.md: add "HTML Linting" section with htmltest documentation
-rw-r--r--README.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/README.md b/README.md
index d6a5acd..59378cb 100644
--- a/README.md
+++ b/README.md
@@ -164,6 +164,44 @@ carousel:
The contents of `static/robots.txt` are from [this site][robotstxt-ai]
and used to prevent the entire site from being indexed by LLM crawlers.
+## HTML Linting
+
+Install [htmltest][]:
+
+```bash
+# install htmltest
+go install https://github.com/wjdp/htmltest@latest
+```
+
+Run [htmltest][] to look for broken internal links and other common
+errors:
+
+```bash
+# run hugo, build site in `./dist`
+hugo --minify -d dist
+
+# run htmltest, ignore links to external sites
+htmltest -c .htmltest.yml -s dist
+```
+
+Results are printed to standard output and saved to
+`./tmp/.htmltest/htmltest.log`.
+
+Run [htmltest][] and check external links:
+
+```bash
+# run hugo, build site in `./dist`
+hugo --minify -d dist
+
+# run htmltest, ignore links to external sites
+htmltest -c .htmltest.yml -s dist
+```
+
+References:
+
+- [htmltest][]
+- [Check links in Hugo with htmltest][htmltest-check-links]
+
## Deploy Site
To clone site repo:
@@ -255,3 +293,7 @@ The [Bulma][] [SASS][] is:
"Lossy compression of PNG images."
[robotstxt-ai]: https://robotstxt.com/ai
"AI / LLM User-Agents: Blocking Guide"
+[htmltest]: https://github.com/wjdp/htmltest
+ "HTML linter which checks for broken links and other errors."
+[htmltest-check-links]: https://robb.sh/posts/check-links-in-hugo-with-htmltest/
+ "Check links in Hugo with htmltest"