diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 44 |
1 files changed, 43 insertions, 1 deletions
@@ -105,7 +105,7 @@ Notes: 2. Use [`pngquant`][pngquant] to shrink [PNGs][png]. 3. Use `gm convert -define web:lossless=true foo.{png,webp}` to compress PNGs and convert them to `webp`s. -4. Use `gm convert foo.{png,webp}` +4. Use `gm convert foo.{jpg,webp}` to compress JPEGs and convert them to to `webp`s. 5. Use the `pe-figure` shortcode for progressive enhanced `figure` tags with a fallback image. @@ -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" |
