Markdown and Twig for Layout


I’m still very new to Grav and am trying to wrap my head around the use of markdown.

I would like to give my users the ability to edit the text of a page but not change the layout or styles associated with a particular element.

At the moment I have just a main container in my twig layout and then I have inline html in my markdown with the classes and container elements.

For example I have a flex container and flex items which are positioned correctly using scss.

Of course this only solves one problem. Users can now edit all the text but can also change the layout and therefore could potentially break the layout.

What is the correct way of getting this done?

One of the great things about markdown is it doesn’t provide all the HTML tags that are potentially dangerous in the hands of users. It just provides enough to create content, and the layout can be controlled via CSS and not easily broken.

This plugin might help you though: