diff options
Diffstat (limited to 'docs/content/en/functions/safe/URL.md')
-rw-r--r-- | docs/content/en/functions/safe/URL.md | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/docs/content/en/functions/safe/URL.md b/docs/content/en/functions/safe/URL.md index edc62ff9d..2ae67bd7f 100644 --- a/docs/content/en/functions/safe/URL.md +++ b/docs/content/en/functions/safe/URL.md @@ -1,23 +1,18 @@ --- title: safe.URL -linkTitle: safeURL -description: Declares the provided string as a safe URL or URL substring. -categories: [functions] +description: Declares the given string as a safe URL or URL substring. +categories: [] keywords: [] -menu: - docs: - parent: functions -function: +action: aliases: [safeURL] + related: + - functions/safe/CSS + - functions/safe/HTML + - functions/safe/HTMLAttr + - functions/safe/JS + - functions/safe/JSStr returnType: template.URL signatures: [safe.URL INPUT] -relatedFunctions: - - safe.CSS - - safe.HTML - - safe.HTMLAttr - - safe.JS - - safe.JSStr - - safe.URL aliases: [/functions/safeurl] --- @@ -27,7 +22,7 @@ Without `safeURL`, only the URI schemes `http:`, `https:` and `mailto:` are cons The following examples use a [site `hugo.toml`][configuration] with the following [menu entry][menus]: -{{< code-toggle file="hugo" copy=false >}} +{{< code-toggle file=hugo >}} [[menu.main]] name = "IRC: #golang at freenode" url = "irc://irc.freenode.net/#golang" @@ -35,7 +30,7 @@ url = "irc://irc.freenode.net/#golang" The following is an example of a sidebar partial that may be used in conjunction with the preceding front matter example: -{{< code file="layouts/partials/bad-url-sidebar-menu.html" copy=false >}} +{{< code file=layouts/partials/bad-url-sidebar-menu.html >}} <!-- This unordered list may be part of a sidebar menu --> <ul> {{ range .Site.Menus.main }} @@ -55,7 +50,7 @@ This partial would produce the following HTML output: The odd output can be remedied by adding ` | safeURL` to our `.URL` page variable: -{{< code file="layouts/partials/correct-url-sidebar-menu.html" copy=false >}} +{{< code file=layouts/partials/correct-url-sidebar-menu.html >}} <!-- This unordered list may be part of a sidebar menu --> <ul> <li><a href="{{ .URL | safeURL }}">{{ .Name }}</a></li> |