Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/colorchestra/smol.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcolorchestra <morph@posteo.de>2020-11-18 20:21:45 +0300
committerGitHub <noreply@github.com>2020-11-18 20:21:45 +0300
commitb4a26052227c37a768846af47dfedeeab187b3f7 (patch)
tree594a88ddf30f9fb35acfe03b7cce8b7f7b7ae0f0
parent3fcb92e2c26e0b9e110ab0c8d1a6afb921c6ac1f (diff)
parentf2dbf084a70b47113f6741455b34e3d65fcdabb1 (diff)
Merge pull request #8 from pfandzelter/add-image-captions
Add Captions to Images
-rw-r--r--layouts/_default/_markup/render-image.html11
-rw-r--r--static/css/style.css3
2 files changed, 14 insertions, 0 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
new file mode 100644
index 0000000..41008ca
--- /dev/null
+++ b/layouts/_default/_markup/render-image.html
@@ -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 }}
+
diff --git a/static/css/style.css b/static/css/style.css
index 3990f6b..d239bd5 100644
--- a/static/css/style.css
+++ b/static/css/style.css
@@ -4,3 +4,6 @@ p > code{color: #FFFFFF; background:#000000; padding:2px}
pre{color: #FFFFFF; background:#000000; padding:24px; overflow-x: auto}
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;}
+figure {margin: auto}