diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-10 00:15:05 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-10 00:15:05 +0200 |
| commit | d340727b78288306685d1cb8047467971afd3147 (patch) | |
| tree | 4c1bfd09adf0dcee571b0e9bed92044c04f8d479 /layouts | |
| parent | 271f0de0b1c3a770390b4cc7130c48f37d9eacc8 (diff) | |
| download | gohugo-theme-ed-d340727b78288306685d1cb8047467971afd3147.tar.gz | |
Create html-tag short code
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/shortcodes/html-tag.html | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/layouts/shortcodes/html-tag.html b/layouts/shortcodes/html-tag.html new file mode 100644 index 0000000..15a7814 --- /dev/null +++ b/layouts/shortcodes/html-tag.html @@ -0,0 +1,4 @@ +{{ $optBlock := dict "display" "block" }} +{{ print "<" | safeHTML }}{{ .Get "tag" | default "div" }}{{ with .Get "id" }} id="{{ . }}"{{ end }}{{ with .Get "class" }} class="{{ . }}"{{ end }}{{ with .Get "style" }} style="{{ . | safeCSS }}"{{ end }}{{ print ">" | safeHTML }} +{{ with .Inner }}{{ . | $.Page.RenderString $optBlock }}{{ end }} +{{ print "</" | safeHTML }}{{ .Get "tag" | default "div" }}{{ print ">" | safeHTML }} |
