This commit is contained in:
xaoxuu 2021-02-22 22:03:02 +08:00
parent 4c4ce9a547
commit 7ffd2f6cda
5 changed files with 8 additions and 3 deletions

View File

@ -11,6 +11,9 @@ function layoutDiv() {
} else if (utterances.theme.light) {
utterances.theme = utterances.theme.light;
}
if (utterances['issue-number']) {
utterances['issue-term'] = null;
}
for (let key of Object.keys(utterances)) {
if (utterances[key]) {
el += ' ' + key + '="' + utterances[key] + '"';

View File

@ -11,7 +11,7 @@
} catch (error) {}
var script = document.createElement('script');
script.src = 'https://utteranc.es/client.js';
const keys = ['repo', 'issue-term', 'theme', 'label', 'crossorigin'];
const keys = ['repo', 'issue-term', 'issue-number', 'theme', 'label', 'crossorigin'];
keys.forEach((key, i) => {
if (el.attributes[key] && el.attributes[key].value) {
script.setAttribute(key, el.attributes[key].value);

View File

@ -10,7 +10,7 @@
const { ArgsMap } = require('./utils');
hexo.extend.tag.register('link', function(args) {
args = ArgsMap(args, ['src'], ['url', 'title', 'description']);
args = ArgsMap(args, ['img'], ['url', 'title', 'description']);
var el = '';
el += '<div class="tag-plugin tag link">';
el += '<a class="link-card" title="' + args.title + '" href="' + args.url + '">';

View File

@ -19,6 +19,7 @@ hexo.extend.tag.register('swiper', function(args, content) {
imgs = imgs.match(/<img(.*?)src="(.*?)"(.*?)>/gi);
if (imgs && imgs.length > 0) {
imgs.forEach((img, i) => {
img = img.replace('<img src', '<img no-lazy src');
el += '<div class="swiper-slide">' + img + '</div>';
});
}

View File

@ -264,6 +264,7 @@ if (stellar.plugins.swiper) {
slidesPerView: 'auto',
spaceBetween: 8,
centeredSlides: true,
loop: true,
pagination: {
el: '.swiper-pagination',
clickable: true,