hakyll icon indicating copy to clipboard operation
hakyll copied to clipboard

Check requires '.html' extension and skips all pages

Open gwern opened this issue 4 years ago • 1 comments

I was testing out check; apparently I have been using it wrong because running check before compilation does nothing (and yields no warning or error) and you're supposed to run it after. The doc doesn't tell you anything about how to run it. It also appears to have some encoding issues:

...
Checking file _site/docs/sunkcosts/index.html
Checking file _site/docs/sunkcosts/2015-danielmead-alwaysastarterneverafinisher.html
hakyll: _site/docs/personal/2012-gwern-personalityproject.html: hGetContents: invalid argument (invalid byte sequence)
Checking file _site/docs/index.html
Checking file _site/docs/personal/aotdisposition_process.html
...

The HTML file in question does declare its text type:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

Anyway, the big problem here is that when I check internal links, it seems to be checking only files with the .html extension. As I use extension-less URLs, this means it skips all of my pages and only covers stuff I generated as redirects or the occasional HTML archive/mirror page. It would make more sense to check all generated HTML files.

gwern avatar Nov 29 '19 18:11 gwern

it seems to be checking only files with the .html extension

This is addressed by #973, just change checkHtmlFile in your Hakyll config.

I'll keep this issue open because the other two problems still exist.

Minoru avatar Apr 04 '23 19:04 Minoru