Link Checker for Go/Hugo?

No worries mate!

There is also this - https://validator.w3.org/checklink

I donā€™t know how to integrate into a CI pipeline though.

1 Like

Just to add an additional alternative. Iā€™ve been looking for solutions using Python scripts, this is one https://pypi.python.org/pypi/LinkChecker

1 Like

Thatā€™s been my alternative to xenu since I switched to Linux. Works fine.

I found nice link check tools written in golang.


And, I released GitHub Actions for above tools.


The following action runs hugo server & and muffet http://localhost:1313

The htmltest tool by @wjdp has been working great for me for few years now. Iā€™d suggest everyone to try that out too.

I had tried muffet when I was testing various link checking solutions, but while it proved to be ā€œfastā€, it gave a loooot of false failures.

htmltest is fast too, and it is spot-on.

2 Likes

I confirm. htmltest is in our CI workflow ā€¦

All awesome news. Will definitely give this a shot. But still think there is value in checking within Hugo. Link checking is table stakes at this point in terms of content management systemsā€¦

Iā€™d love it to be included. Iā€™m migrating a site to Hugo and it would be a big help.

1 Like

Peeking at its readme, the htmltest tool linked above is simple to install and use.

Fair enough, but I really love the watch mode of Hugo, and internal link checking would fit right in there.

Also it panics on my current site. Have not yet been able to narrow down what triggers it.

1 Like

Seems like an overkill for the watch mode and I know that speed is critical for @bep (and all Hugo users, of course). Itā€™s amazing that Hugo keeps getting faster and faster and faster.

I was thinking this would be something built into the hugo build command with a specific flag that would write broken links to a file for better content management.

1 Like

htmltest also doesnā€™t (yet) support baseUrl. Any other suggestions for link checkers? Iā€™ve switched to using {{< ref >}} for my internal links which picks up most, but it doesnā€™t seem to validate # references, which htmltest does.

Sorry, Iā€™d like to embed the check of a url inside my blog when its online instead of checking the links while creation of the page. Lets say I have a link example.com and I want to embed a short notice inside my page if example.com is online.

How do I achieve such a thing in Hugo? For me itā€™s not relevant which tool I use, simplicity is preferred over rich features.

Archiving this thread. @tinfoil-hat, youā€™ll need to search elsewhere, Hugo doesnā€™t have that functionality, and isnā€™t intended to. Good luck! :slight_smile: