Assign template context to var
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
{{ $class := .class }}
|
||||
{{ $content := .content }}
|
||||
{{ $href := .href }}
|
||||
{{ $style := .style }}
|
||||
{{ $params := . }}
|
||||
|
||||
{{ $class := $params.class }}
|
||||
{{ $content := $params.content }}
|
||||
{{ $href := $params.href }}
|
||||
{{ $style := $params.style }}
|
||||
|
||||
<a {{ with $class }} class="{{ . }}" {{ end }} {{ with $href }} href="{{ . | safeURL }}" {{ end }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }}>{{ $content }}</a>
|
||||
|
Reference in New Issue
Block a user