Pre
Returns the
pre property of the given menu entry.Syntax
MENUENTRY.Pre
Returns
template.HTML
In this project configuration we enable rendering of emoji shortcodes, and add emoji shortcodes before (pre) and after (post) each menu entry:
enableEmoji: true
menus:
main:
- name: About
pageRef: /about
post: ':point_left:'
pre: ':point_right:'
weight: 10
- name: Contact
pageRef: /contact
post: ':arrow_left:'
pre: ':arrow_right:'
weight: 20
enableEmoji = true
[menus]
[[menus.main]]
name = 'About'
pageRef = '/about'
post = ':point_left:'
pre = ':point_right:'
weight = 10
[[menus.main]]
name = 'Contact'
pageRef = '/contact'
post = ':arrow_left:'
pre = ':arrow_right:'
weight = 20
{
"enableEmoji": true,
"menus": {
"main": [
{
"name": "About",
"pageRef": "/about",
"post": ":point_left:",
"pre": ":point_right:",
"weight": 10
},
{
"name": "Contact",
"pageRef": "/contact",
"post": ":arrow_left:",
"pre": ":arrow_right:",
"weight": 20
}
]
}
}
To render the menu:
<ul>
{{ range .Site.Menus.main }}
<li>
{{ .Pre | markdownify }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ .Post | markdownify }}
</li>
{{ end }}
</ul>Last updated:
April 10, 2025
:
Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65' (283e97783)
Improve this page