| 1 |
--- |
| 2 |
_comment: Do not remove front matter. |
| 3 |
--- |
| 4 |
|
| 5 |
In this project configuration we enable rendering of [emoji shortcodes][], and add emoji shortcodes before (pre) and after (post) each menu entry: |
| 6 |
|
| 7 |
{{< code-toggle file=hugo >}} |
| 8 |
enableEmoji = true |
| 9 |
|
| 10 |
[[menus.main]] |
| 11 |
name = 'About' |
| 12 |
pageRef = '/about' |
| 13 |
post = ':point_left:' |
| 14 |
pre = ':point_right:' |
| 15 |
weight = 10 |
| 16 |
|
| 17 |
[[menus.main]] |
| 18 |
name = 'Contact' |
| 19 |
pageRef = '/contact' |
| 20 |
post = ':arrow_left:' |
| 21 |
pre = ':arrow_right:' |
| 22 |
weight = 20 |
| 23 |
{{< /code-toggle >}} |
| 24 |
|
| 25 |
To render the menu: |
| 26 |
|
| 27 |
```go-html-template |
| 28 |
<ul> |
| 29 |
{{ range .Site.Menus.main }} |
| 30 |
<li> |
| 31 |
{{ .Pre | markdownify }} |
| 32 |
<a href="{{ .URL }}">{{ .Name }}</a> |
| 33 |
{{ .Post | markdownify }} |
| 34 |
</li> |
| 35 |
{{ end }} |
| 36 |
</ul> |
| 37 |
``` |
| 38 |
|
| 39 |
[emoji shortcodes]: /quick-reference/emojis/ |