diff --git a/layouts/shortcodes/code.html b/layouts/shortcodes/code.html new file mode 100755 index 0000000..462a427 --- /dev/null +++ b/layouts/shortcodes/code.html @@ -0,0 +1,40 @@ +{{- /* +Code block with syntax highlighting. + +@param {string} (positional parameter 0) Syntax highlighting. + +@returns {template.HTML} + +@examples + + {{< code >}} + make && make install && make basic-pbx && make config && ldconfig + {{< /code >}} + + {{< code "bash" >}} + make && make install && make basic-pbx && make config && ldconfig + {{< /code >}} +*/ -}} + +{{ $lang := (.Get 0) }} +{{ $cp := ((printf "clipboard-%s" (delimit (shuffle (seq 11 99)) "")) | md5) }} + +
{{ (trim (.Inner) "\n\r") }}
+