nanxstats / blog-comments

utterances comments
0 stars 1 forks source link

blog/post/link-checker/ #14

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

A Simple Link Checker for Hugo and Blogdown Websites - Nan Xiao | 肖楠

How to create a broken link checker for Hugo and blogdown websites.

https://nanx.me/blog/post/link-checker/

AntoineSoetewey commented 2 years ago

Thanks!

This works like a charm for .com domains, but I couldn't make it work for a .be domain:

Screenshot 2022-02-23 at 12 07 54

Any idea what is the issue?

Moreover, out of curiosity, why do you use absolute URLs instead of relative URLs for internal links? I thought that relative URLs were the best practice for internal links.

Thanks in advance!

nanxstats commented 2 years ago

@AntoineSoetewey It looks like https://easystat.be/tags/ is in the sitemap but it's a 404 page. Your theme needs to have a taxonomy template to render this page. See https://gohugo.io/templates/taxonomy-templates/.

There are probably many good discussions around this topic like https://bookdown.org/yihui/blogdown/html.html. I personally prefer absolute links (with protocol + host domain names) because there is less ambiguity - you don't need more context to know exactly where the links point to. It also treats internal links the same way as the external links. To me, this is ok unless you move things frequently or the content needs to live at multiple endpoints.

AntoineSoetewey commented 2 years ago

Thanks @nanxstats !