Pre 预处理

Pre 预处理


Returns the `pre` property of the given menu entry. 返回给pre定菜单项的属性。

在此站点配置中,我们启用表情符号短代码的渲染,并在每个菜单项之前(前)和之后(后)添加表情符号短代码:

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