refine blockquote & epigraph

This commit is contained in:
loikein 2023-04-17 23:14:50 +01:00
parent d77a621536
commit bb73762987
3 changed files with 14 additions and 15 deletions

View file

@ -151,7 +151,7 @@ p {
/* Chapter Epigraphs */ /* Chapter Epigraphs */
div.epigraph { div.epigraph {
margin: 5em 0; margin: 3em 0;
} }
div.epigraph > blockquote { div.epigraph > blockquote {
@ -185,7 +185,7 @@ blockquote p {
blockquote footer { blockquote footer {
width: 50%; width: 50%;
font-size: 1.1rem; font-size: 1.1rem;
text-align: right; text-align: right !important;
} }
ol, ol,

View file

@ -1,6 +1,8 @@
<blockquote cite="{{ .Get "cite" }}"> <blockquote cite="{{ .Get "cite" }}">
<p> {{ .Inner | $.Page.RenderString (dict "display" "block") }}
{{ .Inner | markdownify }} <footer>
</p> {{- with .Get "author" -}}{{ . }}{{- end -}}
<footer>{{ .Get "footer" }}{{ with .Get "cite" }}, <cite>{{ . }}</cite>{{ end }}</footer> {{- with .Get "cite" -}}, <cite>{{ . | markdownify }}</cite>{{- end -}}
{{- with .Get "detail" -}}, {{ . | markdownify }}{{- end -}}
</footer>
</blockquote> </blockquote>

View file

@ -1,15 +1,12 @@
<div class="epigraph"> <div class="epigraph">
<blockquote> <blockquote>
{{ $t := .Get "type" }} {{ .Inner | $.Page.RenderString (dict "display" "block") }}
{{ if eq $t "compact" }}{{ .Inner | markdownify }}{{ else }}<p>{{ .Inner | markdownify }}</p>{{ end }}
{{ if .IsNamedParams }} {{ if .IsNamedParams }}
<footer> <footer>
{{ with .Get "pre" }}{{ . }}{{ end }} {{- with .Get "author" -}}{{ . }}{{- end -}}
{{ with .Get "link" }}<a href={{ . }}>{{ end }} {{- with .Get "cite" -}}, <cite>{{ . | markdownify }}</cite>{{- end -}}
{{ with .Get "cite" }}<cite>{{ . }}</cite>{{ end }} {{- with .Get "detail" -}}, {{ . | markdownify }}{{- end -}}
</a> </footer>
{{ with .Get "post" }}{{ . }}{{ end }}
</footer>
{{ end }} {{ end }}
</blockquote> </blockquote>
</div> </div>