Learn to build a lean & flexible blogging platform
Developing Our Blog
Finally, we're ready to install Kirby, the handy flat-file CMS we have chosen for this tutorial, and take it for a test drive.
In terms of system requirements, we don't need much to jump off. A current version of PHP (5.3+) should be installed on our system. Feel free to use the popular MAMP / XAMP packages - because they also bring a local webserver and other useful stuff. Alternatively, with PHP 5.4 or newer, you can also start a webserver via command line.
Don't despair if you don't know anything about Git or version control. You won't need a deep knowledge of Git to follow - which makes this the perfect occasion to start learning it. There's a complete online book that is tailored to beginners - and it's free!
After the download has completed, you can have a look at the new folder in your file browser.
You should now have the following files on your disk:
Kirby Project Structure
Let's take a quick tour of the most important parts in a Kirby project:
This is where our actual pages will live. To understand Kirby's logic (which is, luckily, very simple), have a look at the example structure:
Each folder represents a single page. Folder names can be prepended with numbers which are used to sort items (for example when used in a site navigation). Folder names also map to URLs: in this example structure, you can browse to a "projects/project-b" page.
Inside a folder, a simple ".txt" file hosts the page's contents. The file's name is not arbitrary: it determines which template file is used to render the contents. In this case, Kirby will look for a template named "project" (or take a default template if can't find it). Also, any images or other media files are placed inside the page folder.
The kirby folder contains the actual Kirby system files. It's best to keep our hands off this folder and its contents - and let Kirby do its magic.
The same goes for the panel folder: this is also a system component that we should not directly mess with.
The panel provides a management interface for our contents. You can configure it for users that shy away from using Markdown for content editing.
We won't make use of the panel in this tutorial.
This is where we'll spend the majority of our time developing the site.
We'll explore this area in detail later, but let's quickly explain what the folders are there for:
accounts is where Kirby's user management happens. Since, as said, we won't use Kirby's Panel, we won't need this either.
blueprints is also only necessary when you use Kirby's Panel frontend. In short, this is where you configure data entry masks for different page structures.
cache is where cache data is kept. Kirby has an excellent little caching system that boosts your site's speed.
plugins can host any add-ons to Kirby's core funtionality, like a search or a tag cloud generator for example.
snippets holds smaller, reusable parts of your templates. Instead of large, monolithic templates it's better to split them into smaller units that promote reuse and a better overview.
templates will contain one file for each of the main page types we'll have.
This is where Kirby places generated thumbnail images from your content (which is not relevant in this tutorial).
While we're at it: if, after this tutorial, you're just as happy with Kirby as we are, please consider supporting the developer and purchase an (inexpensive) license key for your Kirby project.
Let’s get done with the project setup so we can start developing!
Get our popular Git Cheat Sheet for free!
You'll find the most important commands on the front and helpful best practice tips on the back. Over 100,000 developers have downloaded it to make Git a little bit easier.
As the makers of Tower, the best Git client for Mac and Windows, we help over 100,000 users in companies like Apple, Google, Amazon, Twitter, and Ebay get the most out of Git.
Just like with Tower, our mission with this platform is to help people become better professionals.
That's why we provide our guides, videos, and cheat sheets (about version control with Git and lots of other topics) for free.