Why Koala and not Wordpress?
This blog post should cover reasons behind the creation of Koala - static website generator. The Koala project aims to create simple to use, scalable and fast static website generator.
Initially, I used Blogger platform for my blog. Three years ago, Blogger seemed to be more and more outdated and it did not provide the customization and simplicity I wanted. So, I migrated the blog into Wordpress platform. I used static deployment to my hosting. Initially, I tried to use an active instance, but the speed was not good.
Wordpress engine was running locally on a Debian virtual machine. When I needed to release a new version, WP2Static plug-in did the job. Static deployment was fast, scalable and a more secure solution comparing to an active instance.
Recently, I was working on two computers and virtual machine synchronisation became a big problem. The running virtual machine also consumes system resources that might be missed.
Based on my needs, I established few criteria for the ideal solution:
- Content is statically generated into an efficient code
- Only HTML and CSS knowledge is needed to write a post or a theme
- When using theme templates, simple syntax should be used (e.g. like Handlebars)
Koala uses Wordpress-inspired project layout with the following directories:
- pages - for a permanent content, like About or Privacy
- posts - for blog posts
- static - for a static content, like images or logos
- themes - for themes that provide rendering of the content
Whole website configuration is being held in configuration.json which defines items such as page title, subtitle, URL, path prefix (to host a website at e.g. https://www.example.com/prefix/), or menu.
Koala streamlines developer experience by providing initial project template at https://github.com/KoalaSpace/koala-template. You can click "Use this template" to create your own GitHub repository. When you checkout your new project, you need to install dependencies and initialize the website project by running:
npm install npm run init
When writing your blog posts, or adjusting website template, you can run local server to see the immediate results by running:
When you are ready to go live, simply run:
npm run build
Then it is very simple to copy files from dist directory to your web hosting e.g. over FTP. All architecture components are nicely explained on the following diagram.
Koala currently requires a developer background in order to be used efficiently. My long-term goal is to allow Koala to be used by non-developer users via a user interface (e.g. Electron-based) which should include WYSIWYG editor, automated deployment to AWS and versioning on GitHub.
If you have any question, feel free to reach out on Twitter or on the Koala project website at https://github.com/KoalaSpace/koala-webgen