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 ++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 themes/PaperMod/layouts/shortcodes/blockquote.html (limited to 'themes/PaperMod/layouts/shortcodes/blockquote.html') 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 }} + +
+

{{ .Inner | markdownify }}

+ +
-- cgit v1.2.3