Grav CMS: What makes it better than others?

Simplicity and ease of use makes 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 setup 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 some times 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 to 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 are 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 update or can be cleared using the Grav CLI toos that come bundled with it.

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

What makes Grav better than other flat file CMS?

There are many other flat file CMS’s out there being used by large number of people on a daily basis, 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 a very good user 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

Grav CMS – The future of flat file CMS

Grav is an open source Flat-File CMS written in PHP developed by RocketTheme. When we say Flat-File CMS it means that the Content Management System doesn’t rely on a Database to serve content, instead, it stores content in files that can be a text file or a markdown file depending on what kind of content it is handling or what kind of CMS it is. Flat-File CMS are useful with your I/O for file handling is faster than a Database response or when you don’t have enough resource to power a Database. It is also useful if a specific Database type costs money, Flat-File CMS at times can cost cheaper then a Database driven CMS. There are many Flat-File CMS out there like Statamic, Kirby, PhileCMS and many other. To know what makes Grav a better choice stay tuned.

Grav is one of the fastest flat-file CMS with a cleaner code base that follows the PSR standards. Grav uses YAML that uses the .yaml extension to store system and other various configuration. It uses Markdown files with the .md extension to store content the Markdown files are parsed by Parsedown one of the best PHP based Markdown parser. Grav uses Twig for templating that is one of the most popular PHP-based templating engines. It is also a better templating engine compared to other templating engines because Twig is parsed directly into PHP that makes it really fast.

The benefit of using Twig for templating is that the user does not require knowledge of PHP and can directly read the documentation and start developing themes for it. This is one of the reasons why I love Grav.

Grav has it’s own package manager named GPM was also known as Grav Package Manager that lets the user install/uninstall/update 3rd party plugins and themes. It is also the at the very core of Grav that lets the user update this Grav install on every new update. The GPM package manager makes Grav, even more, user-friendly. Grav also comes with other CLI tools like grav it is similar to GPM. Grav grav CLI lets the user purge cache and manage much other various stuff.

Even after Grav being in the development stage turns out to be very stable. Grav developers are working on an Admin Panel plugin that lets the user have a really nice looking GUI to work with Grav. The Admin panel is currently not yet available it would be available in version 1.0.1, you can find the screenshots over here. Grav is being developed on GitHub.

Grav lets the user create skeletons some skeletons are already available here.

For a developer, Grav has a lot of user in areas where one would prefer file based system or lack resource to have a Database at the same time not lack functionality for this reason. Grav plugins are written in PHP and let 3rd part developers add more functionality to Grav. Grav lets theme developers file written in PHP named after the theme name that can make a connection with plugins or have it’s own unique functionality. Grav lets the theme have its own YML configuration file with a .yaml an extension that lets the theme developer add this/her own configuration with having to mess with the CMS core configuration files.

Grav being a Flat-File CMS also lets the user manage it using version control and sync based system, as the whole system just files. Version Controlling a CMS can be a very good idea at times as it lets the user have a track record of every change made and lets the user revert back to an older build. This can be better achieved on a Flat-File CMS, because If a Database driven CMS is version control like an SQLite driven CMS then only the binary change can be visible and file size as this does not show the big changes made to the system and makes the SQLite driven CMS a much unfriendly option for version control users.

In my opinion, Grav is one of the fastest Flat-File CMS I have ever used and one of the best in the way it works. Grav might be the best alternative to Database driven systems in the near future.

Thanks for reading. This is my first written preview of any web technology. Feel free to give a feedback or ask any questions in a comment below.

Sidewalk theme for Grav

I developed Sidewalk. My first theme for Grav CMS. Grav is a flat-file CMS written in PHP developed by Rocket Themes. The theme is inspired by hexo-jade-barebone.

Installing the theme.

Clone the Sidewalk repository into your Grav CMS theme directory.

cd /user/themes/  
git clone https://github.com/DarrylDias/Sidewalk  

Now change the theme: string to Sidewalk

pages:  
  theme: Sidewalk

Now you have Sidewalk theme running on your Grav CMS.

You can edit the Sidewalk.yaml to customise the theme.