09Grav is an open source flat-file CMS that we have started experimenting with for client documentation. Since it requires no database, it is a simple and great alternative to providing documentation without using separate .doc files. The search feature is especially nice for when you want to search through all documentation.
Demo site for GRAV rtfm skeleton: https://demo.getgrav.org/rtfm-skeleton/basics/overview
Here are some things we’ve learned along the way:
Admin Panel and Editor are very important plugins to have.
Admin Panel creates an admin dashboard at URL sitename/admin. From here, you can install other plugins, edit pages, manage users, and change configuration settings.
Install by going to your GRAV root folder in a terminal and calling your php.exe with “bin/gpm install admin”
Install by going to your GRAV root folder in a terminal and calling your php.exe with “bin/gpm install editor”
To modify the css, access user/themes/learn2/css-compiled/theme.css
In this case, we modified the file to left align all my elements by changing the #chapter ID since my page files are chapter.md. This can be achieved by changing these four “center” properties to “left”
(Before) Center aligned:
(After) Left aligned:
Another case is when we modified sidebar font-size by modifying #sidebar ul.topics > li > a in css-compiled/theme.css
Sidebar Logo (top left):
To change the sidebar logo from default GRAV image, access user/themes/learn2/templates/partials/logo.html.twig
To change the admin sidebar logo from default GRAV image, access: user/plugins/admin/themes/grav/templates/partials/logo.html.twig
Replace what is in the file with the SVG code of the image. This was done by converting a PNG to SVG using https://www.pngtosvg.com/
Example of what SVG looks like:
To modify the sidebar on the left, access user\themes\learn2\templates\partials\sidebar.html.twig
In this case, we wanted to remove the check marks indicating that we had visited that page along with the “Clear History” button on the bottom of the sidebar.
This can be done by removing the relevant lines in the file.
Where to keep your images
We ran into an issue where the images in the images folder would disappear upon caching. This was due to the images folder being in the wrong place. Even though there is a default “images” folder in the root folder, this is not the place to store your images.
Per the official Grav documentation, the images folder should be placed within user/pages:
Do not put images in here:
Instead put them in user/pages/images as depicted here:
On the pages themselves (.md files), link to the images by going up one folder and accessing the images folder with the format (..\images\imagename.png):
Be careful when using underscores (“_”) in the .md file
In markdown, surrounding a word with underscores will result in italicizing that word. This could become an issue since many files we deal with use underscores to separate timestamps from the file name.
The problem can be fixed by “escaping” the underscore by putting a backslash in front of it. Keep in mind that even if we were to escape the underscore between CODE and RELATION, the Markdown language would then try to find the next underscore and would italicize all words in between the underscores (marked in green).
Grav File Uploads
This creates a user who can log into the admin panel and can edit pages.
When these users go to edit the pages, there is a section that allows media uploads.
(Although csv is not listed here, it was able to be added as a xml media type and verified to be working)