Skip to content

Commit ef78472

Browse files
committed
minifying the meta.json even more
1 parent 68cd7e8 commit ef78472

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

gen_search_indexes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ for await (const file of matchingFiles) {
3030
// add to posts
3131
const contentNoHtml = stripHtml(frontmatter.content).result;
3232
const strippedMarkdown = RemoveMarkdown(contentNoHtml)
33-
.replace(/:::.*/, "")
34-
.replace(/:::/, "") // remove admonitions
33+
.replaceAll(/:::.*/g, "")
34+
.replaceAll(/:::/g, "") // remove admonitions
35+
.replaceAll(/[^\S\r\n]{2,}/g); // remove extra spaces
3536

3637
const tags = frontmatter.data.tags || "";
3738

src/routes/search.json/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# meta.json
22

3-
meta.json is a VERY important file, it is highly compressed in order to speed up downloading, do not attempt to modify
3+
meta.json is a VERY important file, it is minified in order to speed up downloading, do not attempt to modify
44
this file by hand! Instead, run the `gen_search_indexes.js` script with Bun or on the CI!
55

66
if you encounter merge problems with this file, do not try to rectify them yourself, instead, delete the file, and run

src/routes/search.json/meta.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)