hexo-theme-shokax 0.5.0-beta2-dev-ec59668 → 0.5.0-beta2-dev-86064c8
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 +1 -1
- package/scripts/generaters/script.js +15 -11
package/package.json
CHANGED
@@ -137,39 +137,43 @@ hexo.extend.generator.register("script", async function(locals) {
|
|
137
137
|
});
|
138
138
|
const res = [];
|
139
139
|
resultApp.outputFiles.forEach((file) => {
|
140
|
+
let fileName = "";
|
141
|
+
if (file.path.split("\\").length > 1) {
|
142
|
+
fileName = file.path.split("\\").pop();
|
143
|
+
} else {
|
144
|
+
fileName = file.path.split("/").pop();
|
145
|
+
}
|
140
146
|
if (file.path.endsWith(".js")) {
|
141
147
|
res.push({
|
142
|
-
path: theme.js + "/" +
|
143
|
-
data: file.
|
148
|
+
path: theme.js + "/" + fileName,
|
149
|
+
data: file.text
|
144
150
|
});
|
145
151
|
} else if (file.path.endsWith(".css")) {
|
146
152
|
res.push({
|
147
|
-
path: theme.css + "/" +
|
148
|
-
data: file.
|
153
|
+
path: theme.css + "/" + fileName,
|
154
|
+
data: file.text
|
149
155
|
});
|
150
156
|
} else {
|
151
157
|
res.push({
|
152
|
-
path: theme.statics + "/" +
|
153
|
-
data: file.
|
158
|
+
path: theme.statics + "/" + fileName,
|
159
|
+
data: file.text
|
154
160
|
});
|
155
161
|
}
|
156
162
|
});
|
157
163
|
hexo.extend.helper.register("preloadjs", function() {
|
158
|
-
const { statics, js } = hexo.theme.config;
|
159
164
|
let resultHtml = "";
|
160
165
|
res.forEach((file) => {
|
161
166
|
if (file.path.endsWith(".js")) {
|
162
|
-
resultHtml += (0, import_hexo_util.htmlTag)("link", { rel: "modulepreload", href: import_hexo_util.url_for.call(this,
|
167
|
+
resultHtml += (0, import_hexo_util.htmlTag)("link", { rel: "modulepreload", href: import_hexo_util.url_for.call(this, file.path) }, "");
|
163
168
|
}
|
164
169
|
});
|
165
170
|
return resultHtml;
|
166
171
|
});
|
167
172
|
hexo.extend.helper.register("load_async_css", function() {
|
168
|
-
const { statics, css } = hexo.theme.config;
|
169
173
|
let resultHtml = "";
|
170
174
|
res.forEach((file) => {
|
171
175
|
if (file.path.endsWith(".css")) {
|
172
|
-
resultHtml += (0, import_hexo_util.htmlTag)("link", { rel: "stylesheet", href: import_hexo_util.url_for.call(this,
|
176
|
+
resultHtml += (0, import_hexo_util.htmlTag)("link", { rel: "stylesheet", href: import_hexo_util.url_for.call(this, file.path), media: "none", onload: "this.media='all'" }, "");
|
173
177
|
}
|
174
178
|
});
|
175
179
|
return resultHtml;
|
@@ -196,7 +200,7 @@ hexo.extend.generator.register("script", async function(locals) {
|
|
196
200
|
});
|
197
201
|
res.push({
|
198
202
|
path: theme.js + "/cf-patch.js",
|
199
|
-
data: resultCF.outputFiles[0].
|
203
|
+
data: resultCF.outputFiles[0].text
|
200
204
|
});
|
201
205
|
}
|
202
206
|
return res;
|