diff options
author | Tobias Pfandzelter <pfandzelter@campus.tu-berlin.de> | 2020-08-05 22:52:27 +0300 |
---|---|---|
committer | Tobias Pfandzelter <pfandzelter@campus.tu-berlin.de> | 2020-08-05 22:52:27 +0300 |
commit | 73ad44e2ca7a5674ce0abc311aa11652cca99801 (patch) | |
tree | 2265a7a17f001771d62af356ed38df211afcd0e6 | |
parent | 41db6a77dc71c5a730ec18fe02080ffe9aa06bb8 (diff) |
add image captions
-rw-r--r-- | layouts/_default/render-image.html | 9 | ||||
-rw-r--r-- | static/css/style.css | 3 |
2 files changed, 12 insertions, 0 deletions
diff --git a/layouts/_default/render-image.html b/layouts/_default/render-image.html new file mode 100644 index 0000000..74f6f95 --- /dev/null +++ b/layouts/_default/render-image.html @@ -0,0 +1,9 @@ +{{ if .Title }} +<figure> + <img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" /> + <figcaption>{{ .Title }}</figcaption> +</figure> +{{ else }} +<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" /> +{{ end }} + diff --git a/static/css/style.css b/static/css/style.css index dfc6325..917a8f7 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -4,3 +4,6 @@ code{color: #FFFFFF; background:#000000; padding:2px} pre{color: #FFFFFF; background:#000000; padding:24px; white-space: pre-wrap} article{padding:24px 0} .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;} + |