💄 add image caption
This commit is contained in:
@@ -73,7 +73,7 @@
|
||||
margin-right 0.5em
|
||||
margin-left 1em
|
||||
.caption
|
||||
color color-grey
|
||||
color froth
|
||||
display block
|
||||
font-size 0.9em
|
||||
margin-top 0.5em
|
||||
@@ -267,6 +267,8 @@ $article-share-link
|
||||
background google-color
|
||||
text-shadow 0 1px darken(google-color, 20%)
|
||||
|
||||
.pswp__caption__center
|
||||
text-align center !important
|
||||
|
||||
@import "tocbot"
|
||||
@import "gallery"
|
||||
|
@@ -118,6 +118,19 @@
|
||||
});
|
||||
})();
|
||||
|
||||
// Caption
|
||||
$(".article-entry").each(function (i) {
|
||||
$(this)
|
||||
.find("img")
|
||||
.each(function () {
|
||||
if ($(this).parent().is("a")) return;
|
||||
|
||||
const { alt } = this;
|
||||
|
||||
if (alt) $(this).after('<span class="caption">' + alt + "</span>");
|
||||
});
|
||||
});
|
||||
|
||||
// Mobile Nav
|
||||
const $content = $(".content"),
|
||||
$sidebar = $(".sidebar");
|
||||
|
Reference in New Issue
Block a user