Is it possible to access page variables when rendering the menu? For example, if a page has the following front matter,
---
title: Title
foo: my-foo
---
, from the menu.html
template, is it possible to access the foo
page variable when rendering the the menu item for the page.
The only variables accessible when rendering a menu item are listed here https://gohugo.io/extras/menus/#what-is-a-menu. Maybe it is possible to look up the page context using the URL menu variable?
I want to access the foo
page variable both when rendering header.html
and when rendering menu.html
to decorate the page title and the menu item depending on the value of foo
.