From bb73762987bb0a76d99a07927db93f0a0835669d Mon Sep 17 00:00:00 2001 From: loikein Date: Mon, 17 Apr 2023 23:14:50 +0100 Subject: [PATCH] refine blockquote & epigraph --- assets/scss/vendor/tufte.scss | 4 ++-- layouts/shortcodes/blockquote.html | 10 ++++++---- layouts/shortcodes/epigraph.html | 15 ++++++--------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/assets/scss/vendor/tufte.scss b/assets/scss/vendor/tufte.scss index 45c9a43..8aebf71 100644 --- a/assets/scss/vendor/tufte.scss +++ b/assets/scss/vendor/tufte.scss @@ -151,7 +151,7 @@ p { /* Chapter Epigraphs */ div.epigraph { - margin: 5em 0; + margin: 3em 0; } div.epigraph > blockquote { @@ -185,7 +185,7 @@ blockquote p { blockquote footer { width: 50%; font-size: 1.1rem; - text-align: right; + text-align: right !important; } ol, diff --git a/layouts/shortcodes/blockquote.html b/layouts/shortcodes/blockquote.html index 8217018..22ad5fd 100644 --- a/layouts/shortcodes/blockquote.html +++ b/layouts/shortcodes/blockquote.html @@ -1,6 +1,8 @@
-

- {{ .Inner | markdownify }} -

-
{{ .Get "footer" }}{{ with .Get "cite" }}, {{ . }}{{ end }}
+{{ .Inner | $.Page.RenderString (dict "display" "block") }} +
+{{- with .Get "author" -}}{{ . }}{{- end -}} +{{- with .Get "cite" -}}, {{ . | markdownify }}{{- end -}} +{{- with .Get "detail" -}}, {{ . | markdownify }}{{- end -}} +
diff --git a/layouts/shortcodes/epigraph.html b/layouts/shortcodes/epigraph.html index d8fa762..74fd3ee 100644 --- a/layouts/shortcodes/epigraph.html +++ b/layouts/shortcodes/epigraph.html @@ -1,15 +1,12 @@
-{{ $t := .Get "type" }} -{{ if eq $t "compact" }}{{ .Inner | markdownify }}{{ else }}

{{ .Inner | markdownify }}

{{ end }} +{{ .Inner | $.Page.RenderString (dict "display" "block") }} {{ if .IsNamedParams }} - + {{ end }}