Search code examples
javascripthtmljekyllgithub-actionsgithub-pages

Github pages' jekyll creates 1 line HTML files


I am using Github pages to deploy a static website built using jekyll. The porject was forked from https://academicpages.github.io/ (I am a beginner in all of this)

For some reason, the "local" (on my machine) behavior of jekyll and the "remote" (i.e. using Github Actions) behavior are different :

Remotely, the built HTML files are 1-liners. This is quite annoying since Javascript comments (starting with \ and ending at the end of the line) are all over the place.

This undesirable behavior is not present locally.

How can I make configure the jekyll from github pages to behave the same locally and remotely ?

Cheers,

Gabriel


Solution

  • This is due to the compress_html plugin in the production config. The dev config doesn't have this so it doesn't minify locally. You could remove the plugin entirely or experiment with options to fit your needs.