hugo_frigg/layouts/shortcodes/quote.html

19 lines
550 B
HTML
Raw Normal View History

2021-10-26 11:34:30 +02:00
<blockquote {{ with .Get "class" }}class="{{ . }}"{{ end }}{{ with .Get "url" }} cite="{{ . }}" {{ end }}>
{{ $s := split (trim .Inner "\t \n") "\n\n" }}
{{ if eq ( first 1 $s) ( last 1 $s )}}
<p>{{ .Inner | markdownify }}</p>
{{ else }}
{{ .Inner | markdownify }}
{{ end }}
{{ if .Get "author" }}
<footer>
<cite>
{{ with .Get "url" }}
<a href="{{ . }}" {{ with $.Get "title"}}title="{{ . }}"{{ end }}>
{{ end }}
{{ .Get "author" | markdownify }}
{{ with .Get "url" }}</a>{{end}}</cite>
</footer>
{{ end }}
</blockquote>