diff options
Diffstat (limited to 'README.md')
-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" |