URL 链接

URL 链接


Returns the relative permalink of the page associated with the given menu entry, else its `url` property. 返回与给定菜单项关联的页面的相对永久链接,否则返回其url属性。

For menu entries associated with a page, the URL method returns the page’s RelPermalink, otherwise it returns the entry’s url property.

对于与页面关联的菜单条目,该URL方法返回页面的RelPermalink,否则返回条目的url属性。

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