Grav - An alternative for small Drupal sites

A client asked us to move his site and update it at the same time, since there isn't much content and given the content does not change a lot, we decided to try something else. Normally we build all of our sites in Drupal, but this time we opted to use Grav.

Grav is a fast lightweight CMS that doesn't use any database, instead it's backend consist of YAML and Markdown for content and config. It's has some plugins (like Drupal modules) and the theming is using Twig

The installation is pretty trivial, download a zip or download an all-in-one package, extract the zip, go to the root directory and run php -S localhost:9999.

They even have a nice admin dashboard which makes managing the site even easier, since - at this moment - this is in beta, it might not be a good idea to use it on a production server. There are more plugins available at http://getgrav.org/downloads/plugins

If you want to get started building sites, you can consult their Learn Grav site, which has extensive documentation, or ask your questions in Gitter.

While building the site we were missing full support for responsive images, so we build something similar to the Picture with sizes formatter we build for the Drupal Picture module. But we made it even easier, the only thing required is

  • a source image
  • min width needed
  • max width needed
  • a step size

The code generates all intermediate images and outputs an img tag with a srcset and sizes attribute. You can find the Grav documentation at http://learn.getgrav.org/content/media#sizes-with-media-queries.

Conclusion

Grav is a very nice system and has a great community, we'll probably use it for other - small - sites, the deciding factor to choose between Grav and Drupal will be:

  • client budget (Dooh)
  • business complexity
  • integration with external systems

Clients site running on Grav: http://its-travelservice.be

Comments

I am very interested to see how you have gone from Drupal to Grav as I am in the same boat. Any chance of getting a more in depth article on this study? Did you try and implement any Drupal approaches such as views?

I was particularly interested in creating modular components as plugins, very similar to features, and then implementing those components into modular pages.