mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
``` git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash ``` Closes #11925
This commit is contained in:
23
docs/content/en/methods/menu-entry/URL.md
Normal file
23
docs/content/en/methods/menu-entry/URL.md
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
title: URL
|
||||
description: Returns the relative permalink of the page associated with the given menu entry, else its `url` property.
|
||||
categories: []
|
||||
keywords: []
|
||||
action:
|
||||
related: []
|
||||
returnType: string
|
||||
signatures: [MENUENTRY.URL]
|
||||
---
|
||||
|
||||
For menu entries associated with a page, the `URL` method returns the page's [`RelPermalink`], otherwise it returns the entry's `url` property.
|
||||
|
||||
|
||||
```go-html-template
|
||||
<ul>
|
||||
{{ range .Site.Menus.main }}
|
||||
<li><a href="{{ .URL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
```
|
||||
|
||||
[`RelPermalink`]: /methods/page/relpermalink
|
Reference in New Issue
Block a user