Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/frjo/hugo-theme-zen.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFredrik Jonsson <frjo@xdeb.org>2022-05-24 20:42:35 +0300
committerFredrik Jonsson <frjo@xdeb.org>2022-05-24 20:42:35 +0300
commitf17836facc890a89231fc4c6cf316bc8ec637f02 (patch)
tree1148ccb74013fb1ff5aeaab0d443137c5bde90c2
parentfa45566cb505f6e7575ec297aa276e6195946198 (diff)
Add button shortcode.
-rw-r--r--layouts/shortcodes/button.html5
1 files changed, 5 insertions, 0 deletions
diff --git a/layouts/shortcodes/button.html b/layouts/shortcodes/button.html
new file mode 100644
index 0000000..a733166
--- /dev/null
+++ b/layouts/shortcodes/button.html
@@ -0,0 +1,5 @@
+{{ $class := .Get "class" -}}
+{{ $newtab := .Get "newtab" | default false -}}
+{{ $src := .Get "src" -}}
+{{ $text := .Get "text" -}}
+<a class="button{{ with $class }} {{ . }}{{ end }}" href="{{ $src }}"{{ if $newtab }} target="_blank" rel="noopener noreferrer"{{ end }}>{{ $text }}</a>