hexo-theme-shokax 0.4.23 → 0.4.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "hexo-theme-shokax",
|
3
|
-
"version": "0.4.
|
3
|
+
"version": "0.4.24",
|
4
4
|
"description": "a hexo theme based on shoka",
|
5
5
|
"main": "index.js",
|
6
6
|
"repository": "https://github.com/theme-shoka-x/hexo-theme-shokaX",
|
@@ -28,6 +28,7 @@
|
|
28
28
|
},
|
29
29
|
"dependencies": {
|
30
30
|
"@algolia/client-search": "^5.21.0",
|
31
|
+
"@common.js/p-limit": "^6.1.0",
|
31
32
|
"@waline/client": "^3.5.6",
|
32
33
|
"algoliasearch": "5.21.0",
|
33
34
|
"dompurify": "^3.2.4",
|
@@ -44,7 +45,6 @@
|
|
44
45
|
"js-yaml": "^4.1.0",
|
45
46
|
"katex": "^0.16.21",
|
46
47
|
"mouse-firework": "^0.1.0",
|
47
|
-
"p-limit": "^6.2.0",
|
48
48
|
"quicklink": "^2.3.0",
|
49
49
|
"theme-shokax-anime": "^0.0.8",
|
50
50
|
"theme-shokax-pjax": "^0.0.3",
|
@@ -109,18 +109,16 @@ hexo.extend.generator.register("summary_ai", async function(locals) {
|
|
109
109
|
const db = new SummaryDatabase();
|
110
110
|
await db.readDB();
|
111
111
|
const postArray = posts.toArray();
|
112
|
-
const pLimit =
|
113
|
-
const concurrencyLimit = pLimit(config
|
112
|
+
const pLimit = require("@common.js/p-limit").default;
|
113
|
+
const concurrencyLimit = pLimit(config?.concurrency || 5);
|
114
114
|
const processingPromises = postArray.map((post) => concurrencyLimit(async () => {
|
115
115
|
const content = post.content;
|
116
116
|
const path = post.path;
|
117
117
|
const published = post.published;
|
118
|
-
hexo.log.info(`[ShokaX Summary AI] \u6587\u7AE0 ${path} \u7684\u6458\u8981\u5904\u7406\u5F00\u59CB`);
|
119
118
|
if (content && path && published && content.length > 0) {
|
120
119
|
try {
|
121
120
|
const summary = await db.getPostSummary(path, content);
|
122
121
|
post.summary = summary;
|
123
|
-
hexo.log.info(`[ShokaX Summary AI] \u6587\u7AE0 ${path} \u7684\u6458\u8981\u5904\u7406\u5B8C\u6210`);
|
124
122
|
} catch (error) {
|
125
123
|
hexo.log.error(`[ShokaX Summary AI] \u5904\u7406\u6587\u7AE0 ${path} \u65F6\u51FA\u9519:`, error.message);
|
126
124
|
post.summary = `${error.message}`;
|