Search code examples
performancetwigtemplatinggrav

Grav CMS possibilities


I just started fiddling with grav and reading their documentation, but I have some questions about what it allows you to do.

In each post, in my markdown file, can I set some yaml or twig variables that link e.g. folder with images, and in template I check if this variable was set and output the Images, and if not I do nothing?

In Wordpress it's quite easy, but I wanted to experiment with something a bit smaller, faster and nicer to write in.


Solution

  • As it turns out, after some time reading grav documentation, I found the answer to my question about creating custom fields, and default variables. It's all described in forms section of grav documentation. (The naming is a bit misleading)

    And you can read about twig variables and twig in general, in sections twig filters & functions, and theme variables.

    Twig documentation is really useful as well.