Themes
The way your Grav site looks is controlled by the Theme. Find out how themes work and how to easily edit or create your own.
Theme Basics
Theme Basics
Themes in Grav are quite simple, and very flexible because they are built with the powerful Twig Templating engine. Every theme is created with a combination of twig files (a mixture of twig-like PHP code and HTML), called templates, and CSS. We typically use Sass CSS Extension to...
Theme Tutorial
Theme Tutorial
Often, the best way to learn a new thing is to use an example, and then try to build your own creation from it. We are going to use this same methodology for creating a new Grav theme.
Quark
Grav comes with a clean and modern theme called Quark which uses the Spectre.css fram...
Twig Primer
Twig Primer
Twig is a quick, optimized template engine for PHP. It is designed from the ground up to make creating templates easier on both the developer and the designer.
Its easy-to-follow syntax and straightforward processes make it a natural fit for anyone familiar with Smarty, Django, Jinja...
Twig Tags, Filters & Functions
Twig Tags, Filters & Functions
Although Twig already provides an extensive list of filters, functions, and tags, Grav also provides a selection of useful additions to make the process of theming easier.
Caution
For information about developing your own custom Twig Filters, check out the...
Theme Configuration
Theme Configuration
In Grav you can easily access theme configuration and blueprint information from your Twig and PHP files.
Accessing Theme Blueprint Information
Information from the currently active theme's blueprints.yaml file can be had from the theme object. Let's use the following b...
Theme Variables
Theme Variables
When you are designing a theme, Grav gives you access to all sorts of objects and variables from within your Twig templates. The Twig templating framework provides powerful ways to read and manipulate these objects and variables. This is fully explained in their own documentatio...
Asset Manager
Asset Manager
In Grav 1.6, the Asset Manager has been completely rewritten to provide a more flexible mechanism for managing CSS and JavaScript assets in themes. The primary purpose of the Asset Manager is to simplify the process of adding assets from themes and plugins while providing enhan...
Customization
Customization
There are many ways to customize a theme, and Grav really doesn't limit your creativity regarding this. However, there are several features and some functionality that Grav provides to make this process easier.
Custom CSS
The simplest way to customize a theme is to provide your o...