Simplicity and ease of use make Grav a real winner

Grav is a free open source flat-file CMS written in PHP developed by RocketTheme, currently in active development, it’s fast and easy to set up and maintain, it supports theme and plugin development, so third party developers can develop themes and plugins for it.

What is a flat-file CMS?

A flat-file CMS stores data in files and does not need a database, compared to most of the CMS out there that are database driven, which means that you need to have a Database (MySQL, MSSQL, PostgreSQL and SQLite) running to get the CMS’s working, these CMS’s query the database to read and write data. However, the performance of a database depends on the specification of the Web Server, database-driven CMS can sometimes take a lot of resource over large numbers, because every request is made the database is queried to fetch the data, which at times can way too much that a server can handle and block the I/O of the Web Server, A flat-file CMS can be more resource-efficient compared to a database-driven CMS.

So, how does Grav work?

Grav uses Markdown files to store page content, these Markdown files are stored in folders that are named after the slug of the page, however you can change the slug by adding a slug string in the page header, headers in the Markdown file store metadata of the page, like the title, date, description, categories, and tag. The Markdown files look like this.

---  
title: Lorem Ipsum  
date: 2015/08/17  
description: A sample post  
taxonomy:  
tag: [sample]  
category: [blog]  
---

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod  
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,  
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo  
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse  
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non  
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.  

Theme development is also a really easy task because it uses Twig for templating which is very easy to learn templating and directly compiled into PHP, it’s easier than PHP based templating, the configuration is YAML files which are easy to read and use.

Grav uses caching, the page is cached on the first request and after that the other users are served the cached page until the timestamp is not changed, it also supports various drivers for caching APC, Memcached and others, by default set the driver is set to auto, caching increases the performance by a large margin, the cache is cleared when Grav is updated or can be cleared using the Grav CLI tools that come bundled with it.

Grav also lets you create a backup of the Grav instance using the CLI tools, the backup is stored as a zip file in the backup folder with the timestamp.

What makes Grav better than other flat file CMS?

There are many other flat-file CMS’s out there being used by many people daily, but how much better is Grav? Let me explain it point wise:

  1. Open Source
  2. Active development
  3. Markdown with Markdown Extra for Pages (Parsedown)
  4. Twig templating
  5. Admin Panel
  6. YAML based configuration files and header.
  7. Third-Party plugin and theme development
  8. CLI Tools (use to install/upgrade packages and more)
  9. Smart Caching
  10. Assets pipeline
  11. Image modification tools
  12. Composer based dependencies management
  13. Offers Skeletons
  14. PSR code base (Grav’s code follows all the PSR)
  15. Backup (using CLI tools)

Now I have listed the point that makes Grav better than the other CMS, here is an example of a Grav powered website link

Thanks to RocketTheme for spent many hours developing Grav and turning it into an exceptionally good user-friendly flat-file CMS. Grav is one of the best flat-file CMS I have ever used.

If you have any query related to Grav, leave a comment below. I promise I won’t act like that MySQL database on a low spec Web Server

I compiled a list of software and services that I use to improve my workflow, here is the link to the list.

Darryl Dias

I’m Darryl. I’m a 3D Artist, Programmer and Linux enthusiast. On this site I share my insights, tips and tricks, tutorials, methods and best practices.