Skip to content

Commit

Permalink
separate themes & plugins file (#2038)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang authored Jul 29, 2023
1 parent 2e53540 commit 4c0920d
Show file tree
Hide file tree
Showing 836 changed files with 6,940 additions and 7,555 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"cheerio": "^0.22.0",
"hexo": "^7.0.0-rc1",
"hexo": "7.0.0-rc1",
"hexo-clean-css": "^2.0.0",
"hexo-filter-nofollow": "^2.0.2",
"hexo-fs": "^4.1.1",
Expand Down
22 changes: 22 additions & 0 deletions scripts/data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* global hexo */

'use strict';

hexo.extend.filter.register('before_generate', async () => {
const Data = hexo.model('Data');
for (const type of ['themes', 'plugins']) {
const arr = [];
Data.forEach(({_id, data}) => {
if (_id.startsWith(type)) {
arr.push({
name: _id.replace(type + '/', ''),
...data
});
}
});
await Data.insert({
_id: type,
data: arr
});
}
}, 0);
Loading

0 comments on commit 4c0920d

Please sign in to comment.