From 54375572e11d23dacb20c5742d171af3072d7b9c Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Thu, 28 Nov 2024 00:46:17 +0300 Subject: Серьезная реновация MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layouts/shortcodes/figure.html | 38 ++++++++++++++++++++++++++++++++++++++ layouts/shortcodes/gist.html | 1 + layouts/shortcodes/quote.html | 15 +++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 layouts/shortcodes/figure.html create mode 100644 layouts/shortcodes/gist.html create mode 100644 layouts/shortcodes/quote.html (limited to 'layouts/shortcodes') diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html new file mode 100644 index 0000000..a4bae51 --- /dev/null +++ b/layouts/shortcodes/figure.html @@ -0,0 +1,38 @@ + + {{- if .Get "link" -}} + + {{- end -}} + + {{- $u := urls.Parse (.Get "src") -}} + {{- $src := $u.String -}} + {{- if not $u.IsAbs -}} + {{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}} + {{- $src = .RelPermalink -}} + {{- end -}} + {{- end -}} + + {{ with .Get + {{- if .Get "link" }}{{ end -}} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} +
+ {{ with (.Get "title") -}} + {{ . }} + {{- end -}} + {{- if or (.Get "caption") (.Get "attr") -}}

+ {{- .Get "caption" | markdownify -}} + {{- with .Get "attrlink" }} + + {{- end -}} + {{- .Get "attr" | markdownify -}} + {{- if .Get "attrlink" }}{{ end }}

+ {{- end }} +
+ {{- end }} + \ No newline at end of file diff --git a/layouts/shortcodes/gist.html b/layouts/shortcodes/gist.html new file mode 100644 index 0000000..783fa1e --- /dev/null +++ b/layouts/shortcodes/gist.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/layouts/shortcodes/quote.html b/layouts/shortcodes/quote.html new file mode 100644 index 0000000..09bb07c --- /dev/null +++ b/layouts/shortcodes/quote.html @@ -0,0 +1,15 @@ +
+

{{ .Inner | markdownify }}

+ {{- if or (.Get "author") (.Get "source") -}} + + {{- if .Get "author" -}} + + {{- .Get "author" -}}{{- if .Get "source" -}}, {{ end -}} + + {{- end -}} + {{- with .Get "url" -}}{{- end -}} + {{ .Get "source" }} + {{- if .Get "url" -}}{{- end -}} + + {{- end -}} +
\ No newline at end of file -- cgit v1.2.3