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

gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/kbd.html')
-rw-r--r--layouts/shortcodes/kbd.html21
1 files changed, 21 insertions, 0 deletions
diff --git a/layouts/shortcodes/kbd.html b/layouts/shortcodes/kbd.html
new file mode 100644
index 0000000..e6421b3
--- /dev/null
+++ b/layouts/shortcodes/kbd.html
@@ -0,0 +1,21 @@
+<!--
+ usage:
+ kdb "Ctrl" "Shift" "i"
+
+ output:
+ Ctrl + Shift + i
+-->
+
+{{ $semanticKeyboardKeys := slice }}
+
+{{ range .Params }}
+ {{ $currentKey := printf "<kbd>%s</kbd>" . }}
+
+ {{ $semanticKeyboardKeys = $semanticKeyboardKeys | append $currentKey }}
+{{ end }}
+
+{{ if gt $semanticKeyboardKeys 1 }}
+ <kbd>{{- delimit $semanticKeyboardKeys "+" -}}</kbd>
+{{ else }}
+ {{- delimit $semanticKeyboardKeys "+" -}}
+{{ end }} \ No newline at end of file