Jekyll: Documentation: HTML Proofer with baseurl

Created on 10 Nov 2015  ·  3Comments  ·  Source: jekyll/jekyll

I find this page very helpful:

http://jekyllrb.com/docs/continuous-integration/

However when trying to enable htmlproof, I ran into an issue. I am using site.baseurl in all my links, images, etc. And sure enough htmlproof fails on every request.

frozen-due-to-age

Most helpful comment

To work around this, put your site in a subdirectory of _site which corresponds to your site.baseurl. Run bundle exec jekyll build -d _site/my/baseurl and run htmlproof like usual against _site (the base). The links should then work as intended.

All 3 comments

To work around this, put your site in a subdirectory of _site which corresponds to your site.baseurl. Run bundle exec jekyll build -d _site/my/baseurl and run htmlproof like usual against _site (the base). The links should then work as intended.

Worked great. Thanks.

Sadly, the workaround requires hard coding baseurl in more places than just _config.yml. Bummer.

In any case, two more workarounds. (In my case, repo is 'dev', i.e. Links become /dev/\.)
--url-swap \'/dev/:/\' (or)
ln -s _site _site/dev

The latter you will have to rerun each time, as build, or even serve, removes the link. You may want to script it. The ln is also circular, but seems to work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MertcanGokgoz picture MertcanGokgoz  ·  3Comments

muromtsev picture muromtsev  ·  3Comments

behrangs-sportsbet picture behrangs-sportsbet  ·  3Comments

weilinzung picture weilinzung  ·  3Comments

aeberbach picture aeberbach  ·  4Comments