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 */
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,

View file

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

View file

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