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
Ctrl+Shift+I and you should see
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
You can disable this with the
in Chrome, or you can use another browser like Firefox, or setup a
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