Test Luapress locally without web server

The Luapress documentation introduces environments to distinguish between development builds and production builds. Development builds are handy because you do not need to shove your files to the web server in order to see the result. However, the documentation seems to assume a locally running web server, and there is no need for that.

This is the variant from the documentation, which requires a local web server:

dev = {
    url = 'http://localhost/mysite',
    build_dir = 'dev',
},

Instead you can just use file as protocol, like so:

dev = {
    url = 'file://PATH_TO_WEBSITE_DIRECTORY/dev',
    build_dir = 'dev',
},

You need to replace PATH_TO_WEBSITE_DIRECTORY with something like /home/myuser/mywebsite.

That's it, just point your browser to dev/index.html and you will see your website locally, (almost) perfectly linked, without the need for a locally running web server.

Minor problems:

  • The title link does not point to index.html, thus you get a directory listing.
  • The RSS page does not have a style attached. No idea where it comes from when the page is online.
  • Javascript might not work. This is something I do not use and do not care about.
2016-07-17