hugo/docs/content/en/methods/menu-entry/_common/pre-post.md
Bjørn Erik Pedersen 5fd1e74903
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
```
git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash
```

Closes #11925
2024-01-27 10:48:57 +01:00

739 B

In this site configuration we enable rendering of emoji shortcodes, and add emoji shortcodes before (pre) and after (post) each menu entry:

{{< code-toggle file=hugo >}} enableEmoji = true

menus.main name = 'About' pageRef = '/about' post = '👈' pre = '👉' weight = 10

menus.main name = 'Contact' pageRef = '/contact' post = '⬅️' pre = '➡️' weight = 20 {{< /code-toggle >}}

To render the menu:

<ul>
  {{ range .Site.Menus.main }}
    <li>
      {{ .Pre | markdownify }}
      <a href="{{ .URL }}">{{ .Name }}</a>
      {{ .Post | markdownify }}
    </li>
  {{ end }}
</ul>