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) }} + +
+
+
+ {{ if ($lang) }}{{ $lang = (printf "class='language-%s'" ($lang)) }}{{ end }} +
{{ (trim (.Inner) "\n\r") }}
+
+
+ +
+
+
diff --git a/layouts/shortcodes/mention.html b/layouts/shortcodes/mention.html index 8e7240d..c8f65ad 100644 --- a/layouts/shortcodes/mention.html +++ b/layouts/shortcodes/mention.html @@ -5,7 +5,7 @@ @examples - {{< mention "KitsuneSolar" >}} + {{< mention "username" >}} */ -}} {{- if (.Get 0) -}}