fix: load tags correctly, updatel lilybird

This commit is contained in:
Jozef Steinhübl 2024-01-02 11:24:04 +01:00
parent 0549763a3e
commit cda50448db
No known key found for this signature in database
GPG key ID: E944BC293F5FF7E7
3 changed files with 4 additions and 5 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -16,7 +16,7 @@
"@paperdave/logger": "^3.0.1", "@paperdave/logger": "^3.0.1",
"algoliasearch": "^4.19.1", "algoliasearch": "^4.19.1",
"gray-matter": "^4.0.3", "gray-matter": "^4.0.3",
"lilybird": "^0.4.1", "lilybird": "0.4.2",
"zlib-sync": "^0.1.8" "zlib-sync": "^0.1.8"
} }
} }

View file

@ -12,14 +12,13 @@ import { Glob } from "bun";
type PartialGuildTextChannel = PartialChannel<GuildTextChannel>; type PartialGuildTextChannel = PartialChannel<GuildTextChannel>;
const tags = Array.from( const TAGS_PATH = join(import.meta.dir, "..", "..", "data", "tags");
new Glob(join(import.meta.dir, "..", "..", "data", "tags", "*.md")).scanSync() const tags = Array.from(new Glob("*.md").scanSync(TAGS_PATH));
);
export const TAGS: Tag[] = []; export const TAGS: Tag[] = [];
for (const tag of tags) { for (const tag of tags) {
const content = readFileSync(tag); const content = readFileSync(join(TAGS_PATH, tag));
const frontMatter = matter(content); const frontMatter = matter(content);
TAGS.push({ TAGS.push({