mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Merge commit '35dec7c96f7ee3eb17dd444f7067f0c776fb56ae'
This commit is contained in:
@@ -1,29 +1,24 @@
|
||||
---
|
||||
title: safe.HTMLAttr
|
||||
linkTitle: safeHTMLAttr
|
||||
description: Declares the provided string as a safe HTML attribute.
|
||||
categories: [functions]
|
||||
description: Declares the given key/value pair as a safe HTML attribute.
|
||||
categories: []
|
||||
keywords: []
|
||||
menu:
|
||||
docs:
|
||||
parent: functions
|
||||
function:
|
||||
action:
|
||||
aliases: [safeHTMLAttr]
|
||||
related:
|
||||
- functions/safe/CSS
|
||||
- functions/safe/HTML
|
||||
- functions/safe/JS
|
||||
- functions/safe/JSStr
|
||||
- functions/safe/URL
|
||||
returnType: template.HTMLAttr
|
||||
signatures: [safe.HTMLAttr INPUT]
|
||||
relatedFunctions:
|
||||
- safe.CSS
|
||||
- safe.HTML
|
||||
- safe.HTMLAttr
|
||||
- safe.JS
|
||||
- safe.JSStr
|
||||
- safe.URL
|
||||
aliases: [/functions/safehtmlattr]
|
||||
---
|
||||
|
||||
Given a site configuration that contains this menu entry:
|
||||
|
||||
{{< code-toggle file="hugo" >}}
|
||||
{{< code-toggle file=hugo >}}
|
||||
[[menu.main]]
|
||||
name = "IRC"
|
||||
url = "irc://irc.freenode.net/#golang"
|
||||
@@ -35,7 +30,7 @@ Attempting to use the `url` value directly in an attribute:
|
||||
{{ range site.Menus.main }}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
```
|
||||
```
|
||||
|
||||
Will produce:
|
||||
|
||||
|
Reference in New Issue
Block a user