Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
uiolee committed Aug 6, 2023
1 parent df9c53e commit a8126e8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions scripts/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ hexo.extend.filter.register('before_generate', async () => {
for (const type of ['themes', 'plugins']) {
const arr = [];
Data.forEach(({_id, data}) => {
if (_id.startsWith(type)) {
if (_id.startsWith(type + '/')) {
arr.push({
name: _id.replace(type + '/', ''),
...data
});
}
});
if (Data.has(type)) {
await Data.replaceById(type, {
_id: type,
data: arr
});
await Data.replaceById(type, { data: arr });
} else {
await Data.insert({
_id: type,
Expand Down

0 comments on commit a8126e8

Please sign in to comment.