diff --git a/lib/bangumi-generator.js b/lib/bangumi-generator.js index 4117d83..885b59b 100644 --- a/lib/bangumi-generator.js +++ b/lib/bangumi-generator.js @@ -112,7 +112,7 @@ module.exports = /*#__PURE__*/function () { showMyComment: (_config$type$showMyCo = config[type].showMyComment) !== null && _config$type$showMyCo !== void 0 ? _config$type$showMyCo : false, pagination: (_config$type$paginati = config[type].pagination) !== null && _config$type$paginati !== void 0 ? _config$type$paginati : false, theme: fs.existsSync(path.join(__dirname, "templates/theme/".concat(config.theme, ".min.css"))) ? config.theme : null, - ejsTemplate: fs.readFileSync(path.join(__dirname, "templates/".concat(config[type].source === 'bgm' ? 'bgm' : 'bili', "-template.ejs"))).toString().replace('class="bangumi-item"', 'class="bangumi-item bangumi-hide"'), + ejsTemplate: fs.readFileSync(path.join(__dirname, "templates/".concat(config[type].source === 'bili' ? 'bili' : 'bgm', "-template.ejs"))).toString().replace('class="bangumi-item"', 'class="bangumi-item bangumi-hide"'), wantWatch: wantWatch, watched: watched, watching: watching, diff --git a/lib/templates/bangumi.ejs b/lib/templates/bangumi.ejs index 6cbb5a6..474d84b 100644 --- a/lib/templates/bangumi.ejs +++ b/lib/templates/bangumi.ejs @@ -29,12 +29,12 @@
<% if (pagination) { %> <% wantWatch.slice(0, 10).forEach(function(item){ %> - <%- include((source === 'bgm' ? 'bgm' : 'bili') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> + <%- include((source === 'bili' ? 'bili' : 'bgm') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> <% }); %> <%- include('pagination.ejs', {__: __}) %> <% } else { %> <% wantWatch.forEach(function(item){ %> - <%- include((source === 'bgm' ? 'bgm' : 'bili') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> + <%- include((source === 'bili' ? 'bili' : 'bgm') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> <% }); %> <%- include('pagination.ejs', {__: __}) %> <% } %> @@ -42,12 +42,12 @@
<% if (pagination) { %> <% watching.slice(0, 10).forEach(function(item){ %> - <%- include((source === 'bgm' ? 'bgm' : 'bili') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> + <%- include((source === 'bili' ? 'bili' : 'bgm') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> <% }); %> <%- include('pagination.ejs', {__: __}) %> <% } else { %> <% watching.forEach(function(item){ %> - <%- include((source === 'bgm' ? 'bgm' : 'bili') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> + <%- include((source === 'bili' ? 'bili' : 'bgm') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> <% }); %> <%- include('pagination.ejs', {__: __}) %> <% } %> @@ -55,18 +55,19 @@
<% if (pagination) { %> <% watched.slice(0, 10).forEach(function(item){ %> - <%- include((source === 'bgm' ? 'bgm' : 'bili') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> + <%- include((source === 'bili' ? 'bili' : 'bgm') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> <% }); %> <%- include('pagination.ejs', {__: __}) %> <% } else { %> <% watched.forEach(function(item){ %> - <%- include((source === 'bgm' ? 'bgm' : 'bili') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> + <%- include((source === 'bili' ? 'bili' : 'bgm') + '-template.ejs', {item,loading,metaColor,type,lazyloadAttrName,srcValue}) %> <% }); %> <%- include('pagination.ejs', {__: __}) %> <% } %>
diff --git a/package.json b/package.json index 5f4eab3..42ba0d5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hexo-bilibili-bangumi", - "version": "1.8.7", + "version": "1.8.8", "description": "hexo bilibili番剧页", "main": "index.js", "scripts": { diff --git a/src/lib/bangumi-generator.js b/src/lib/bangumi-generator.js index 6279b7b..1311aaa 100644 --- a/src/lib/bangumi-generator.js +++ b/src/lib/bangumi-generator.js @@ -79,7 +79,7 @@ module.exports = async function (locals, type = 'bangumi') { showMyComment: config[type].showMyComment ?? false, pagination: config[type].pagination ?? false, theme: fs.existsSync(path.join(__dirname, `templates/theme/${config.theme}.min.css`)) ? config.theme : null, - ejsTemplate: fs.readFileSync(path.join(__dirname, `templates/${config[type].source === 'bgm' ? 'bgm' : 'bili'}-template.ejs`)).toString() + ejsTemplate: fs.readFileSync(path.join(__dirname, `templates/${config[type].source === 'bili' ? 'bili' : 'bgm'}-template.ejs`)).toString() .replace('class="bangumi-item"', 'class="bangumi-item bangumi-hide"'), wantWatch, watched,