Questions about the Grav site theme

The Grav site theme is wonderful in itself.

Any chance this is available for the people who want to run Grav?

And IS the Grav site written in Grav? (No points off, if not. :wink: )

The Grav site theme is basically Antimatter, or in other-words the default theme that comes with Grav. The only minor differences are that it has extra CSS for downloads and this forum, and slightly different colors.

You can actually see it in action and compare:


And YES!, we eat our own dogfood. Both and are 100% written in Grav (version 0.9.2 currently)

I’m really curious about how on the Grav site, you’ve managed to have a modular page, but the navigation points external pages. How have you managed to do that?

eg, to get 01.modular and 02.modular in the menu, without any of the sub pages showing up…


This is all done from the Twig templates. If you look at the antimatter theme, the templates/modular.html.twig file is specifically looping over the page.collection (ie modular pages) and displaying a menu item for each modular section.

{% block header_navigation %}
<ul class="navigation">
    {% for module in page.collection() %}

            {% set current_module = ( or module.activeChild) ? 'active' : '' %}
            <li class="{{ current_module }}"><a href="#{{ _self.pageLinkName( }}">{{ }}</a></li>

    {% endfor %}
{% endblock %}

In the site’s theme, we have a customized modular.html.twig, that does not have this kind of navigation block defined, it simply uses the same navigation as the rest of the pages.

Hi Andy,
I tried to replicate what you did on the website and I must have overlooked something.
Originally I set up the Antimatter blog skeleton, and now I added a modular page (one page skeleton) where I tried to clear the modular.html.twig file from its navigation bit just as you suggested. Then I added back the block with {{parent}} as the only navigation instruction.
Yet this is not enough for navigation to work from the modular page back to the (default) blog part.

Could you zip up your antimatter theme folder and share with me? I really need to see what you are doing in the Twig templates.

Very kind of you.

Well i’m a little bit stumped. The code looks fine. And even looking at your site, the menu shows correctly, but I can’t click the links on the modular page.

Also I noticed the tags don’t seem to be working on the blog page.

So I would check to make sure you don’t have any javascript on that modular page that could be intercepting the clicks, because I don’t think it’s a CSS z-index issue as I can hover over the menu still and they get the hover animation.

The other thing is if you have any extra caching plugins enabled, disable them.


I know what it is. I was right it is a JavaScript that is intercepting the links. It’s specifically the singlePageNav.min.js that powers the onpage-menu.

To remove this you would need to remove all the references to that in the antimatter/templates/modular.html.twig file:

{% extends 'partials/base.html.twig' %}

{% block content %}
    {{ page.content }}
    {% for module in page.collection() %}
        {{ module.content }}
    {% endfor %}
{% endblock %}

That should be all that is needed

Many thanks for looking into this Andy))
The blog tags seemed to work ok before I changed anything though (actually there was no reason a .js set on the modular page would impact them, or is there?).

Caching as always been an issue and I mentioned it to you when I couldn’t get to update images on the fly. But it was mostly an issue with earlier version of Grav conflicting with my hosting which enables varnish caching.

So hopefully you have all working now?

Yes, varnish cache is a very static cache, that you would have to tell explicitly if anything changes. It could be possible to do this with a plugin. Might be something for me to look at later.

Actually you were right previously: tags are not working. Do I need to sanitize javascript elsewhere too?

shouldn’t, that’s the only place. Did you define your taxonomy in your site.yaml?

Taxonomy is the default one with the skeleton, ie. Category and Tags. I think I didn’t change anything there. Tags used to work so where should I look?

Tags should be working fine if they are defined in site.yaml and are used in a page.

I guess something broke it along the way because site.yaml is ok (taxonomies: category, tag, month) and tags are properly displayed in posts and in the tag list.
I will try to rebuild the site from skeleton and perform the couple tweaks that are important along the way to the current
Thank you)

I’m trying to do the same thing. I want both the main menu and the onpage menu visible on the same site. By editing the modular.html.twig file I always seem to break something… Not that I really understand almost any of it.

Could you point me to a good example or give some beginner-level instructions how to do this?

I’m only familiar with hmtl and css so have to do some learning with grav :slight_smile: