From 29fcd231e3da9b33c237886f3c1bb30a557ad641 Mon Sep 17 00:00:00 2001 From: Indrajith K L Date: Sat, 19 Mar 2022 16:54:23 +0530 Subject: Initial Commit --- themes/PaperMod/layouts/shortcodes/blockquote.html | 72 ++++++++++++++++++++++ themes/PaperMod/layouts/shortcodes/collapse.html | 8 +++ themes/PaperMod/layouts/shortcodes/figure.html | 31 ++++++++++ themes/PaperMod/layouts/shortcodes/ltr.html | 15 +++++ themes/PaperMod/layouts/shortcodes/rawhtml.html | 2 + themes/PaperMod/layouts/shortcodes/rtl.html | 15 +++++ 6 files changed, 143 insertions(+) create mode 100644 themes/PaperMod/layouts/shortcodes/blockquote.html create mode 100644 themes/PaperMod/layouts/shortcodes/collapse.html create mode 100644 themes/PaperMod/layouts/shortcodes/figure.html create mode 100644 themes/PaperMod/layouts/shortcodes/ltr.html create mode 100644 themes/PaperMod/layouts/shortcodes/rawhtml.html create mode 100644 themes/PaperMod/layouts/shortcodes/rtl.html (limited to 'themes/PaperMod/layouts/shortcodes') diff --git a/themes/PaperMod/layouts/shortcodes/blockquote.html b/themes/PaperMod/layouts/shortcodes/blockquote.html new file mode 100644 index 0000000..14bb107 --- /dev/null +++ b/themes/PaperMod/layouts/shortcodes/blockquote.html @@ -0,0 +1,72 @@ + + + + + +{{ $.Scratch.Set "bl_author" false }} +{{ $.Scratch.Set "bl_source" false }} +{{ $.Scratch.Set "bl_link" false }} +{{ $.Scratch.Set "bl_title" false }} + +{{ if .IsNamedParams }} + {{ $.Scratch.Set "bl_author" (.Get "author") }} + {{ $.Scratch.Set "bl_source" (.Get "source") }} + {{ $.Scratch.Set "bl_link" (.Get "link") }} + {{ $.Scratch.Set "bl_title" (.Get "title") }} +{{ else }} + +{{ end }} + + + +{{ with $.Scratch.Get "bl_title" }} + +{{ else }} + {{ with $.Scratch.Get "bl_link" }} + {{ range last 1 (split ($.Scratch.Get "bl_link" ) "://") }} + {{ $.Scratch.Set "title_without_protocol" . }} + {{ end }} + {{ range last 1 (split ($.Scratch.Get "title_without_protocol" ) "www.") }} + {{ $.Scratch.Set "title_without_protocol" . }} + {{ end }} + {{ $.Scratch.Set "bl_title" ($.Scratch.Get "title_without_protocol") }} + + + {{ if (gt (len ($.Scratch.Get "title_without_protocol") ) 32) }} + {{ $title := (slicestr ($.Scratch.Get "title_without_protocol") 0 32) }} + {{ $split_by_fw_slash := split $title "/" }} + {{ $count := (sub (len $split_by_fw_slash) 1) }} + + {{ $.Scratch.Set "tempstring" "" }} + {{ range first $count $split_by_fw_slash }} + {{ $.Scratch.Set "tempstring" ( . | printf "%s%s/" ($.Scratch.Get "tempstring") | printf "%s" ) }} + {{ end }} + {{ $.Scratch.Set "bl_title" ( printf "%s..." ($.Scratch.Get "tempstring") | printf "%s" ) }} + {{ end }} + {{ end }} +{{ end }} + +
+diff --git a/themes/PaperMod/layouts/shortcodes/collapse.html b/themes/PaperMod/layouts/shortcodes/collapse.html new file mode 100644 index 0000000..17d8d3b --- /dev/null +++ b/themes/PaperMod/layouts/shortcodes/collapse.html @@ -0,0 +1,8 @@ +{{ if .Get "summary" }} +{{ else }} +{{ warnf "missing value for param 'summary': %s" .Position }} +{{ end }} +{{ .Inner | markdownify }}
+ +
{{ .Get "summary" | markdownify }}
+ {{ .Inner | markdownify }}
+