diff options
author | Simon Guest <simon.guest@tesujimath.org> | 2022-06-08 18:59:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-08 18:59:23 +0300 |
commit | 955bb8dd7ff445258be80f954581f4c21df4fce0 (patch) | |
tree | 44ed55be8e727e7d9561ecd8c8c293a12e39d1b8 /layouts | |
parent | 0a5cbea10f1ca13fa2f47dae4c6ab4d783ab71ab (diff) |
feat(shortcodes): add quote shortcode, and example (#414)
* Add quote shortcode, and example
* Use trim to improve whitespace
* Allow for quote with neither author nor source
* Format code and move quote.scss to article.scss
This style is only used on the article page, so it makes more sense to have it there.
Co-authored-by: Jimmy Cai <github@jimmycai.com>
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/shortcodes/quote.html | 15 |
1 files changed, 15 insertions, 0 deletions
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 @@ +<blockquote> + <p>{{ .Inner | markdownify }}</p> + {{- if or (.Get "author") (.Get "source") -}} + <span class="cite"><span>― </span> + {{- if .Get "author" -}} + <span> + {{- .Get "author" -}}{{- if .Get "source" -}}, {{ end -}} + </span> + {{- end -}} + {{- with .Get "url" -}}<a href="{{ . }}">{{- end -}} + <cite>{{ .Get "source" }}</cite> + {{- if .Get "url" -}}</a>{{- end -}} + </span> + {{- end -}} +</blockquote>
\ No newline at end of file |