Skip to content

Commit 51c0652

Browse files
eilnmarcan
authored andcommitted
layouts: Support linking source in image captions
Doesn't break (previous) entries without "source", you can't tell they're just empty, zero-space paragraphs. Also minor CSS improvements in multi-line captions. Signed-off-by: Eileen Yoon <[email protected]>
1 parent 83b71d8 commit 51c0652

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

layouts/shortcodes/captioned.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
<figure class="captioned">{{ .Inner }}
2-
{{ with .Get "caption"}}<figcaption><p>{{.}}</p></figcaption>{{end}}
2+
<figcaption>
3+
{{ with .Get "caption"}}<p>{{.}}</p>{{end}}
4+
{{ with .Get "link"}}<p><a href={{.}}>{{end}}{{ with .Get "source"}}Source: {{.}}</a>{{end}}</p>
5+
</figcaption>
36
</figure>

static/css/main.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,8 @@ p img, figure img {
981981
padding-top: 10px;
982982
max-width: 100%;
983983
height: auto;
984+
margin-top: 15px;
985+
margin-bottom: 10px;
984986
}
985987

986988
.center {
@@ -994,13 +996,17 @@ p img, figure img {
994996
}
995997

996998
.post figure figcaption p {
997-
margin-top: 10px;
998-
margin-bottom: 10px;
999+
margin: 0;
9991000
text-align: center;
10001001
font-weight: 300;
10011002
font-size: 80%;
10021003
}
10031004

1005+
.post figure {
1006+
margin-top: 20px;
1007+
margin-bottom: 20px;
1008+
}
1009+
10041010
/* Blog */
10051011

10061012
.blog-header {

0 commit comments

Comments
 (0)