Skip to content

Commit

Permalink
Merge branch 'hexojs/master' into add-api-section
Browse files Browse the repository at this point in the history
  • Loading branch information
uiolee committed Sep 25, 2023
2 parents a1d8932 + 39ec805 commit 0a6b26c
Show file tree
Hide file tree
Showing 886 changed files with 7,495 additions and 7,879 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
pull-requests: write # for marocchino/sticky-pull-request-comment to create or update PR comment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- name: Use Node.js
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
},
"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",
"hexo-generator-archive": "^2.0.0",
"hexo-generator-feed": "^3.0.0",
"hexo-generator-sitemap": "^3.0.1",
"hexo-renderer-marked": "^6.0.0",
"hexo-renderer-pug": "^3.0.0",
"hexo-renderer-stylus": "^3.0.0",
"hexo-server": "^3.0.0",
"hexo-tag-embed": "^1.0.0-rc.1",
Expand All @@ -33,12 +32,11 @@
"eslint-config-hexo": "^5.0.0",
"husky": "^8.0.1",
"imagemin-lint-staged": "^0.5.1",
"lint-staged": "^13.0.3"
"lint-staged": "^14.0.1"
},
"lint-staged": {
"*.{png,jpeg,jpg,gif,svg}": [
"imagemin-lint-staged",
"git add"
"imagemin-lint-staged"
],
"*.js": "eslint --fix"
},
Expand Down
26 changes: 26 additions & 0 deletions scripts/data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* 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
});
}
});
if (Data.has(type)) {
await Data.replaceById(type, { data: arr });
} else {
await Data.insert({
_id: type,
data: arr
});
}
}
}, 0);
Loading

0 comments on commit 0a6b26c

Please sign in to comment.