hexo-theme-amane/source/js/main.js

18 lines
655 B
JavaScript
Raw Normal View History

2016-02-02 16:19:44 +00:00
(function($){
2018-10-16 05:28:42 +00:00
$('.article img:not(".not-gallery-item")').each(function () {
// wrap images with link and add caption if possible
if ($(this).parent('a').length === 0) {
$(this).wrap('<a class="gallery-item" href="' + $(this).attr('src') + '"></a>');
if (this.alt) {
$(this).after('<div class="has-text-centered is-size-6 has-text-grey caption">' + this.alt + '</div>');
2018-04-28 19:13:05 +00:00
}
}
2018-10-16 05:28:42 +00:00
});
2018-10-16 05:28:42 +00:00
if (typeof(moment) === 'function') {
$('.article-meta time').each(function () {
$(this).text(moment($(this).attr('datetime')).fromNow());
});
2018-10-16 05:28:42 +00:00
}
})(jQuery);