-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
separate themes & plugins file (#2038)
- Loading branch information
1 parent
2e53540
commit 4c0920d
Showing
836 changed files
with
6,940 additions
and
7,555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Oops, something went wrong.