diff options
author | Paul Duncan <pabs@pablotron.org> | 2025-05-12 16:36:38 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2025-05-12 16:36:38 -0400 |
commit | fbb8548c3cab2b581f28d869843bf87bd805f4b9 (patch) | |
tree | 43d35f4fec9953e439b8c3a6000d4f39c8b725d7 | |
parent | dcf573e2330fd71152cf845989bd5f3ec8f6d40e (diff) | |
download | pablotron.org-fbb8548c3cab2b581f28d869843bf87bd805f4b9.tar.xz pablotron.org-fbb8548c3cab2b581f28d869843bf87bd805f4b9.zip |
README.md: add "HTML Linting" section with htmltest documentation
-rw-r--r-- | README.md | 42 |
1 files changed, 42 insertions, 0 deletions
@@ -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" |