From 900bb5e845c3ad44defbd427cae3d44a4a43321f Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Sat, 25 Feb 2023 13:15:44 +0100 Subject: feat: Initial commit --- code/frontpage/layouts/shortcodes/alert.html | 12 ++++++++++++ code/frontpage/layouts/shortcodes/details.html | 4 ++++ code/frontpage/layouts/shortcodes/email.html | 1 + code/frontpage/layouts/shortcodes/mermaid.html | 8 ++++++++ code/frontpage/layouts/shortcodes/video.html | 11 +++++++++++ 5 files changed, 36 insertions(+) create mode 100644 code/frontpage/layouts/shortcodes/alert.html create mode 100644 code/frontpage/layouts/shortcodes/details.html create mode 100644 code/frontpage/layouts/shortcodes/email.html create mode 100644 code/frontpage/layouts/shortcodes/mermaid.html create mode 100644 code/frontpage/layouts/shortcodes/video.html (limited to 'code/frontpage/layouts/shortcodes') diff --git a/code/frontpage/layouts/shortcodes/alert.html b/code/frontpage/layouts/shortcodes/alert.html new file mode 100644 index 0000000..e2abe8e --- /dev/null +++ b/code/frontpage/layouts/shortcodes/alert.html @@ -0,0 +1,12 @@ + diff --git a/code/frontpage/layouts/shortcodes/details.html b/code/frontpage/layouts/shortcodes/details.html new file mode 100644 index 0000000..61a7183 --- /dev/null +++ b/code/frontpage/layouts/shortcodes/details.html @@ -0,0 +1,4 @@ + + {{ with .Get 0 -}}{{ . | safeHTML }}{{ else -}}{{ errorf "No summary provided"}}{{ end -}} + {{ with .Inner -}}{{ . | markdownify}}{{ else -}}{{ errorf "No details provided"}}{{ end -}} + \ No newline at end of file diff --git a/code/frontpage/layouts/shortcodes/email.html b/code/frontpage/layouts/shortcodes/email.html new file mode 100644 index 0000000..88674fc --- /dev/null +++ b/code/frontpage/layouts/shortcodes/email.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/code/frontpage/layouts/shortcodes/mermaid.html b/code/frontpage/layouts/shortcodes/mermaid.html new file mode 100644 index 0000000..aeecad5 --- /dev/null +++ b/code/frontpage/layouts/shortcodes/mermaid.html @@ -0,0 +1,8 @@ +{{ if .Page.Params.mermaid -}} +
+ {{ $data := replaceRE "(^\\s+```)" "" .Inner -}} + {{ replaceRE "(```\\s+$)" "" $data -}} +
+{{ else -}} + {{ errorf "Failed to process mermaid shortcode: %s. Set mermaid to true in page front matter." .Position }} +{{ end -}} diff --git a/code/frontpage/layouts/shortcodes/video.html b/code/frontpage/layouts/shortcodes/video.html new file mode 100644 index 0000000..784c3a7 --- /dev/null +++ b/code/frontpage/layouts/shortcodes/video.html @@ -0,0 +1,11 @@ +
+ + {{ with .Get "webm-src" -}} + + {{ end -}} + {{ with .Get "mp4-src" -}} + + {{ end -}} + Sorry, your browser doesn't support embedded videos. + +
-- cgit v1.3