Merge pull request #8 from pfandzelter/add-image-captions

Add Captions to Images
This commit is contained in:
colorchestra 2020-11-18 18:21:45 +01:00 committed by GitHub
commit b4a2605222
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,11 @@
{{ if .Title }}
<figure>
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
<figcaption>{{ .Title }}</figcaption>
</figure>
{{ else }}
<figure>
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" />
</figure>
{{ end }}

View file

@ -4,3 +4,6 @@ p > code{color: #FFFFFF; background:#000000; padding:2px}
pre{color: #FFFFFF; background:#000000; padding:24px; overflow-x: auto} pre{color: #FFFFFF; background:#000000; padding:24px; overflow-x: auto}
article{padding:24px 0} article{padding:24px 0}
.center {display: block;margin-left: auto;margin-right: auto;width: 100%;} .center {display: block;margin-left: auto;margin-right: auto;width: 100%;}
img {display: block; max-width: 100%; height: auto;}
figcaption {color: #888; font: 12px/1.5 monospace; text-align: center;}
figure {margin: auto}