Skip to content

Commit 3a9d19e

Browse files
committed
surely this is fine
1 parent c5955b7 commit 3a9d19e

52 files changed

Lines changed: 1271 additions & 1185 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
permissions:
1313
contents: write
1414
steps:
15-
- uses: actions/create-github-app-token@v1
15+
- uses: actions/create-github-app-token@v2
1616
id: app-token
1717
with:
1818
app-id: ${{ secrets.INDEX_BOT_ID }}
@@ -23,7 +23,7 @@ jobs:
2323
ref: ${{ github.head_ref }}
2424
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config
2525
persist-credentials: false
26-
- uses: oven-sh/setup-bun@v2.0.1
26+
- uses: oven-sh/setup-bun@v2
2727
- run: bun install
2828
- run: bun ./gen_search_indexes.js
2929
- run: git add .

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"cSpell.words": ["tabler"]
2+
"cSpell.words": ["tabler"],
3+
// set default language mode of .svx files to markdown
4+
"files.associations": {
5+
"*.svx": "markdown"
6+
}
37
}

bun.lock

Lines changed: 148 additions & 278 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gen_search_indexes.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import { file as defineFile, Glob, write } from "bun";
1+
import { file as defineFile, Glob, write, markdown } from "bun";
22
import matter from "gray-matter";
33
import { stripHtml } from "string-strip-html";
44
import { createConsola } from "consola";
5-
import RemoveMarkdown from "remove-markdown";
65

76
const log = createConsola({
87
formatOptions: {
@@ -29,7 +28,7 @@ for await (const file of matchingFiles) {
2928

3029
// add to posts
3130
const contentNoHtml = stripHtml(frontmatter.content).result;
32-
const strippedMarkdown = RemoveMarkdown(contentNoHtml)
31+
const strippedMarkdown = markdown.render(contentNoHtml, {})
3332
.replaceAll(/:::.*/g, "")
3433
.replaceAll(/:::/g, "") // remove admonitions
3534
.replaceAll(/[^\S\r\n]{2,}/g, ""); // remove extra spaces
@@ -52,4 +51,4 @@ for await (const file of matchingFiles) {
5251
log.start("Writing to file...");
5352
await write("./src/routes/search.json/meta.json", JSON.stringify(posts));
5453

55-
log.success("Done!");
54+
log.success("Done! Finished in " + Bun.nanoseconds() / 1e6 + " milliseconds.");

0 commit comments

Comments
 (0)