From 941642aee876a97dbb79666d8fabaa2b1feb9ff5 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sun, 20 Mar 2022 00:38:25 +0530 Subject: Theme changes --- themes/terminal/layouts/shortcodes/code.html | 15 +++++++++++++++ themes/terminal/layouts/shortcodes/figure.html | 8 ++++++++ themes/terminal/layouts/shortcodes/image.html | 3 +++ themes/terminal/layouts/shortcodes/prismjs.html | 25 +++++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 themes/terminal/layouts/shortcodes/code.html create mode 100644 themes/terminal/layouts/shortcodes/figure.html create mode 100644 themes/terminal/layouts/shortcodes/image.html create mode 100644 themes/terminal/layouts/shortcodes/prismjs.html (limited to 'themes/terminal/layouts/shortcodes') diff --git a/themes/terminal/layouts/shortcodes/code.html b/themes/terminal/layouts/shortcodes/code.html new file mode 100644 index 0000000..8bab825 --- /dev/null +++ b/themes/terminal/layouts/shortcodes/code.html @@ -0,0 +1,15 @@ +{{ $id := delimit (shuffle (seq 1 9)) "" }} + +{{ if .Get "language" }} +
+ + +
{{ .Inner | string }}
+
+{{ else }} + {{ errorf "If you want to use the \"collapsable code\" shortcode, you need to pass a mandatory \"language\" param. The issue occured in %q (%q)" .Page.File .Page.Permalink }} +{{ end }} diff --git a/themes/terminal/layouts/shortcodes/figure.html b/themes/terminal/layouts/shortcodes/figure.html new file mode 100644 index 0000000..6642c82 --- /dev/null +++ b/themes/terminal/layouts/shortcodes/figure.html @@ -0,0 +1,8 @@ +{{ if .Get "src" }} +
+ {{ . | plainify }} + {{ if .Get "caption" }} +
{{ .Get "caption" | safeHTML }}
+ {{ end }} +
+{{ end }} diff --git a/themes/terminal/layouts/shortcodes/image.html b/themes/terminal/layouts/shortcodes/image.html new file mode 100644 index 0000000..6b2a2c0 --- /dev/null +++ b/themes/terminal/layouts/shortcodes/image.html @@ -0,0 +1,3 @@ +{{ if .Get "src" }} + {{ . | plainify }} +{{ end }} diff --git a/themes/terminal/layouts/shortcodes/prismjs.html b/themes/terminal/layouts/shortcodes/prismjs.html new file mode 100644 index 0000000..e4acffe --- /dev/null +++ b/themes/terminal/layouts/shortcodes/prismjs.html @@ -0,0 +1,25 @@ +{{ $inner := replaceRE "^\r?\n" "" .Inner | string }} +{{ if len .Params | eq 0 }} +
{{ $inner }}
+{{ else }} + {{ if .IsNamedParams }} +
{{ $inner }}
+ {{ else }} +
+      {{ $inner }}
+ {{ end }} +{{ end }} -- cgit v1.2.3