[MacTUG] For Herbert: Building Faster Websites with Grav, a Modern Flat-file CMS

Marlon A. Griffith m3griffi at uwaterloo.ca
Wed Dec 7 10:56:23 EST 2016


Hey Herbert,

I don't have your email so here goes...

Marlon
---------------

"""
What Is Grav and Why Should I Use It?

Grav is a modern, flat-file CMS, developed by RocketTheme. Why modern? Because it uses modern PHP and latest standards like Markdown, Twig, YAML, Doctrine Cache, etc. Flat-file CMS means that there’s no database involved, and instead all the site’s content and configuration settings are stored in plain text files.

To grasp this relatively new concept better, imagine a regular, HTML-based website, as in the good old days, but with added ability to create and maintain the actual HTML files dynamically. While you picture this view, bear in mind two things:

     First, Grav is not a static site generator. The content is written in Markdown files, and these files are processed and converted to HTML files dynamically on demand. You won’t find any static HTML file inside your site directory.
     Second, even though Grav doesn’t use a database, it still gives you a way to manipulate your content dynamically — almost as a database-driven CMS such as WordPress.

So, you can think of Grav as a kind of a hybrid, combining the best from both static and dynamic worlds. Furthermore, a flat-file CMS gives you some additional very attractive advantages:

     A database-free site eliminates all the headaches and bottlenecks that dealing with a database can bring.
     Because you deal with files only, you can easily add 100% version control for all of them by using Git and services like GitHub or GitBucket.
     You can copy all of your content and configuration files and move them wherever you wish, which makes your site completely portable and easy to back up.

No matter whether you are a developer, a designer, or just a user, Grav may have something for you.

Grav is developer friendly
It offers many useful tools for developers such as a CLI Console, GPM (Grav Package Manager), and a Debug Bar. All these tools make for easier developing, debugging, installing and updating themes and plugins.

Grav is designer friendly
Designers often aren’t experienced coders, and they need an easy way to bring their designs to life. With the power and simplicity of the Twig template engine, this can be done fairly easily. Using Twig to output PHP is as simple as using a CSS preprocessor, like Sass, for outputting CSS.

Grav is user friendly
Thanks to the Admin Panel plugin, users can create and manipulate their site’s content, and manage the entire site itself, in a convenient GUI-ified way.
...

Grav’s Advantages and Disadvantages

In this section, I’m going to outline what are, in my view, Grav’s main strengths and weaknesses.

Grav Advantages

     Built with modern technologies. Modern PHP standards, Markdown, Twig, YAML, etc.
     Very fast. Thanks to its flat-file architecture and clever cache mechanisms.
     More secure. There’s no database to be hacked.
     Instant install with zero configuration. Just unzip the package and you’re ready to go. No database creation or configuration bottleneck.
     File-based instead of database-based. This means, if something goes wrong while you edit a file, only that file will be damaged; if you use database-driven CMS, the entire database can be corrupted.
     Easy and secure backup and restore. You can zip your entire website and transport it wherever you want. It’s much easier than backing up and restoring a database.
     100% version control. Adding version control to your files is a piece of cake. (Versioning a database can be pain in the neck.)
     Simple and clean content creation with Markdown. But you can also use HTML, or even mix them both.
     Unlimited taxonomies. You can label and filter your content as you wish, with no extra coding steps.
     Built-in image editing. You can edit your images as you add them.
     Easy to customize. You’re free to use whatever CSS framework you like. Theming is a breeze. No PHP knowledge required.
     Easy to extend. You can choose from existing plugins or you can easily write your own thanks to Grav’s flexible and modular architecture.
     CLI tools. There are several console tools, such as GPM, which facilitate the developer’s job.
     Debugging and logging capabilities. You can make use of a handy Debug Bar while developing themes and plugins.
     Powerful yet simple Admin Panel, with one-click installs and updates.
     Multi-Site capabilities. You can run several sites with one Grav instance.
     Multi-Language support. Translate your site in as many languages as you wish.
     Minimal learning curve. There is almost nothing new to learn. The use of PHP is reduced to a minimum. Learning Markdown, Twig or YAML can be done in one day or one weekend, if you already don’t know them.
     Great documentation. Every part of Grav is clearly explained. In fact, Grav is so easy that once you grasp the basic concepts, you can further learn it by exploring the code in already existing themes and plugins.
     Many free and ready-to-use themes, plugins, and skeletons. In addition to the traditional themes and plugins, Grav offers skeletons — all-in-one thematic packages consisting of Grav the core, a theme, plugins, and sample content.
     Free and open sourced under the MIT license.

Grav Disadvantages

     Not suitable for heavy commercial sites, with thousands of pages to process, and which need complex database relationships.
     Can be challenging to built a complex site. It’s possible, but you’ll need to create a lot of custom functionality.
     Road testing. Not tested yet for a sufficient variety of websites and in different conditions.
     Markdown dependent. End users have to learn to use Markdown (although that’s not difficult to learn). Usually end users and clients are used to writing their content with a WYSIWYG editor.
     Not GUI-ified enough. Grav compared to WordPress or Joomla is like Sublime Text compared to a full-blown IDE, such as WebStorm. Currently, there are still things that require manual configuration or manipulation.

http://www.sitepoint.com/building-faster-websites-with-grav-a-modern-flat-file-cms/
"""


More information about the MacTUG mailing list