fix bugs
This commit is contained in:
parent
4c4ce9a547
commit
7ffd2f6cda
|
@ -11,6 +11,9 @@ function layoutDiv() {
|
||||||
} else if (utterances.theme.light) {
|
} else if (utterances.theme.light) {
|
||||||
utterances.theme = utterances.theme.light;
|
utterances.theme = utterances.theme.light;
|
||||||
}
|
}
|
||||||
|
if (utterances['issue-number']) {
|
||||||
|
utterances['issue-term'] = null;
|
||||||
|
}
|
||||||
for (let key of Object.keys(utterances)) {
|
for (let key of Object.keys(utterances)) {
|
||||||
if (utterances[key]) {
|
if (utterances[key]) {
|
||||||
el += ' ' + key + '="' + utterances[key] + '"';
|
el += ' ' + key + '="' + utterances[key] + '"';
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
var script = document.createElement('script');
|
var script = document.createElement('script');
|
||||||
script.src = 'https://utteranc.es/client.js';
|
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) => {
|
keys.forEach((key, i) => {
|
||||||
if (el.attributes[key] && el.attributes[key].value) {
|
if (el.attributes[key] && el.attributes[key].value) {
|
||||||
script.setAttribute(key, el.attributes[key].value);
|
script.setAttribute(key, el.attributes[key].value);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* link.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
* link.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
|
||||||
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
||||||
*
|
*
|
||||||
* {% link url title [description] [img:src] %}
|
* {% link url title [description] [img:src] %}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
const { ArgsMap } = require('./utils');
|
const { ArgsMap } = require('./utils');
|
||||||
|
|
||||||
hexo.extend.tag.register('link', function(args) {
|
hexo.extend.tag.register('link', function(args) {
|
||||||
args = ArgsMap(args, ['src'], ['url', 'title', 'description']);
|
args = ArgsMap(args, ['img'], ['url', 'title', 'description']);
|
||||||
var el = '';
|
var el = '';
|
||||||
el += '<div class="tag-plugin tag link">';
|
el += '<div class="tag-plugin tag link">';
|
||||||
el += '<a class="link-card" title="' + args.title + '" href="' + args.url + '">';
|
el += '<a class="link-card" title="' + args.title + '" href="' + args.url + '">';
|
||||||
|
|
|
@ -19,6 +19,7 @@ hexo.extend.tag.register('swiper', function(args, content) {
|
||||||
imgs = imgs.match(/<img(.*?)src="(.*?)"(.*?)>/gi);
|
imgs = imgs.match(/<img(.*?)src="(.*?)"(.*?)>/gi);
|
||||||
if (imgs && imgs.length > 0) {
|
if (imgs && imgs.length > 0) {
|
||||||
imgs.forEach((img, i) => {
|
imgs.forEach((img, i) => {
|
||||||
|
img = img.replace('<img src', '<img no-lazy src');
|
||||||
el += '<div class="swiper-slide">' + img + '</div>';
|
el += '<div class="swiper-slide">' + img + '</div>';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -264,6 +264,7 @@ if (stellar.plugins.swiper) {
|
||||||
slidesPerView: 'auto',
|
slidesPerView: 'auto',
|
||||||
spaceBetween: 8,
|
spaceBetween: 8,
|
||||||
centeredSlides: true,
|
centeredSlides: true,
|
||||||
|
loop: true,
|
||||||
pagination: {
|
pagination: {
|
||||||
el: '.swiper-pagination',
|
el: '.swiper-pagination',
|
||||||
clickable: true,
|
clickable: true,
|
||||||
|
|
Loading…
Reference in New Issue