@xingwangzhe/stalux 1.5.2 → 1.5.3
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/src/internal/font-subset.ts +15 -0
package/package.json
CHANGED
|
@@ -204,6 +204,21 @@ function collectCommonChars(projectRoot: string): string {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
// Also scan post frontmatter for tags, categories so those pages' chars are covered
|
|
208
|
+
const postsDir = resolve(projectRoot, CONTENT_ROOT, "posts");
|
|
209
|
+
if (existsSync(postsDir)) {
|
|
210
|
+
for (const f of readdirSync(postsDir)) {
|
|
211
|
+
if (!f.endsWith(".md") && !f.endsWith(".mdx")) continue;
|
|
212
|
+
if (f.startsWith("_")) continue;
|
|
213
|
+
try {
|
|
214
|
+
const content = readFileSync(join(postsDir, f), "utf-8");
|
|
215
|
+
for (const ch of content) chars.add(ch);
|
|
216
|
+
} catch {
|
|
217
|
+
/* skip */
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
207
222
|
return [...chars].sort().join("");
|
|
208
223
|
}
|
|
209
224
|
|