qr-code

FAQ

Why does my page look ugly/un-styled?

Maybe you are using Google Chrome and you're trying to view your site locally using a file:///path/to/your/site/out/index.html scheme. Open the JavaScript console Ctrl+Shift+I and you should see something like:

XMLHttpRequest cannot load file:///path/to/your/site/out/out/style/css/o-blog.less. Cross origin requests are only supported for HTTP.
less-1.2.1.min.js:8Uncaught Error: NETWORK_ERR: XMLHttpRequest Exception 101

If so, that is a known Chrome issue with loading local javascript files, and is actually a security feature in Chrome.

You can disable this with the --allow-file-access-from-files option in Chrome, or you can use another browser like Firefox, or setup a local webserver.

To use a local webserver, there are many complex solutions such as nginx or Apache or many others. If you prefer a lighter and simpler solution using Python, simply run:

cd /path/to/your/site && python -m SimpleHTTPServer

…and browse http://localhost:8000

Or within Emacs you can run the emacs-http-server:

(require 'httpd)
(setq httpd-root "/path/to/your/site")
(httpd-start)

…and browse http://localhost:8080

Another alternative would be the use of elnode but it seems to be more complex.

Why html pages are not minified?

HTML compression very tricky. Things can easily go wrong. Using a GZip compression would be more efficient.

Anyway if you still want to minify your pages, you can have a look to htmlcompressor, yuicompressor and Closure compiler. You can also read Juriy Zaytsev's articles on optimizing HTML and experimenting with html minifier.

So here is the magic! Once your site is generated, you can run the following command:

htmlcompressor --compress-js --compress-css --recursive --mask '*.js;*.html;*.xml;*.css;*.less' -o /path/to/out/ /path/to/out