Skip to content

Commit

Permalink
更新依赖(#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
HCLonely committed Mar 26, 2021
1 parent 867157e commit eb0ab98
Show file tree
Hide file tree
Showing 11 changed files with 1,094 additions and 550 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
.history/
49 changes: 0 additions & 49 deletions .history/package_20210217103151.json

This file was deleted.

49 changes: 0 additions & 49 deletions .history/package_20210217104659.json

This file was deleted.

49 changes: 0 additions & 49 deletions .history/package_20210217105241.json

This file was deleted.

4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
Expand Down
16 changes: 9 additions & 7 deletions lib/bangumi-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ module.exports = /*#__PURE__*/function () {

wantWatch = [];
watching = [];
watched = [];
console.log(path.join(this.source_dir, '/_data/bangumis.json'));
watched = []; // console.log(path.join(this.source_dir, '/_data/bangumis.json'))

if (!fs.existsSync(path.join(this.source_dir, '/_data/bangumis.json'))) {
log.info('Can\'t find bilibili bangumi data, please use \'hexo bangumi -u\' command to get data');
Expand Down Expand Up @@ -87,7 +86,8 @@ module.exports = /*#__PURE__*/function () {
}

__ = i18n.__(config.language);
contents = ejs.renderFile(path.join(__dirname, 'templates/bangumi.ejs'), {
_context.next = 12;
return ejs.renderFile(path.join(__dirname, 'templates/bangumi.ejs'), {
quote: config.bangumi.quote,
show: config.bangumi.show || 1,
loading: config.bangumi.loading,
Expand All @@ -98,10 +98,12 @@ module.exports = /*#__PURE__*/function () {
watching: watching,
__: __,
root: root
}, function (err, result) {
if (err) console.log(err);
return result;
}, {
async: false
});

case 12:
contents = _context.sent;
return _context.abrupt("return", {
path: config.bangumi.path || 'bangumis/index.html',
data: {
Expand All @@ -111,7 +113,7 @@ module.exports = /*#__PURE__*/function () {
layout: ['page', 'post']
});

case 13:
case 14:
case "end":
return _context.stop();
}
Expand Down
18 changes: 9 additions & 9 deletions lib/templates/bangumi.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</blockquote>
<% } %>
<style>
<% include index.css %>
<%- include('index.css') %>
</style>
<div class="bangumi-tabs">
<a class="bangumi-tab" id="bangumi-tab1" href="javascript:;" rel="external" target="_self" onclick="return false">
Expand All @@ -20,25 +20,25 @@
<div>
<div id="bangumi-item1">
<% wantWatch.forEach(function(item){ %>
<% include template.ejs %>
<%- include('template.ejs', {item,loading,metaColor}) %>
<% }); %>
<% include pagination.ejs %>
<%- include('pagination.ejs', {__: __}) %>
</div>
<div id="bangumi-item2">
<% watching.forEach(function(item){ %>
<% include template.ejs %>
<%- include('template.ejs', {item,loading,metaColor}) %>
<% }); %>
<% include pagination.ejs %>
<%- include('pagination.ejs', {__: __}) %>
</div>
<div id="bangumi-item3">
<% watched.forEach(function(item){ %>
<% include template.ejs %>
<%- include('template.ejs', {item,loading,metaColor}) %>
<% }); %>
<% include pagination.ejs %>
<%- include('pagination.ejs', {__: __}) %>
</div>
</div>
<script>
<% include index.js %>
<%- include('index.js') %>
tabs[<%- show %>].click();
<% include pagination.js %>
<%- include('pagination.js', {__: __}) %>
</script>
2 changes: 1 addition & 1 deletion lib/templates/template.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</div>
<div class="bangumi-info">
<div class="bangumi-title">
<a target="_blank" href="https://www.bilibili.com/bangumi/media/md<%= item.id %>/"><%= item.title || Unknown %></a>
<a target="_blank" href="https://www.bilibili.com/bangumi/media/md<%= item.id %>/"><%= item.title || 'Unknown' %></a>
</div>
<div class="bangumi-meta">
<span class="bangumi-info-items" <%- metaColor %>>
Expand Down
Loading

0 comments on commit eb0ab98

Please sign in to comment.