Post
Returns the
post
property of the given menu entry.Syntax
MENUENTRY.Post
Returns
template.HTML
In this site 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:
December 4, 2023
:
Squashed 'docs/' changes from 4d936aee6..4dd2d6415 (35dec7c96)
Improve this page