Jekyll generates a static site in a given directory (by default, _site
). Running jekyll serve
builds the site and then sets up a server such that the site can be viewed locally on the specified port (e.g. localhost:4000
by default). I'm wondering if there is a way to activate this serve
behavior without triggering the gem to recompile the site first.
Alternatively, it would be sufficient to use some other tool to serve the site from a localhost port without using jekyll, but I'm not sure how to do that (node.js?). While I can open the static files directly in a browser, this doesn't find all the relative url links (to css, etc) correctly, defaulting links such as /css/default.css
to the root file://css/default.css
instead, which of course does not exist there.
(This would be useful, for instance, because Jekyll takes quite some time to build a large site, and certain plugins I use need internet access to various APIs. It would be nice to view the site offline without triggering these).
node-static
. But, if the site's still building, the files may not actually be available yet.npm
, but when I trystatic
in the site directory I get no console output and nothing visible at localhost:8080... not sure what I missed...