Previewing
Because nanoc runs on your local PC, the compiled site is not immediately put online on your server. This way, you can preview the entire site before uploading it to your host.
Previewing HTML files directly
The easiest way to preview the nanoc-generated site is by viewing the generated HTML files (usually residing in the output directory) directly.
If you are using absolute URLs (URLs that start with a slash, such as "/images/picture.png"), though, this won't work well: none of the CSS will be loaded, images won't show up, etc.
Using a staging server
You can set up a staging server using Apache, lighttpd, or anything else, to preview your site. However, this can be a time-consuming process, especially if you're not used to setting up web servers. Running a public web server might not even be possible.
Using heel or adsf
heel and adsf are small web servers aimed at serving static files. When running heel or adsf, a local web server will be started in the given directory (or a custom directory when the -r option is passed). heel and adsf are ideal companions to nanoc.
heel works best with the --no-highlighting option, which ensures that CSS files are not converted to syntax-highlighted HTML. adsf, which is a replacement for heel, does not have this issue.
To start heel or adsf with the "output" directory as webroot, cd to the nanoc site directory and run
heel -r output
or
adsf -r output
The server will be started. When using heel, a new browser window will automatically pop up.
Using the nanoc autocompiler
nanoc 2.0 includes an autocompiler, which is a server that compiles pages on request. To run it, type:
nanoc aco
which will start the server on port 3000. If you want to customize the port, use the -p switch, like this:
nanoc aco -p 8080
