diff --git a/components/pages/nav-bar.tsx b/components/pages/nav-bar.tsx index 51c597c..2993939 100644 --- a/components/pages/nav-bar.tsx +++ b/components/pages/nav-bar.tsx @@ -139,7 +139,7 @@ const HeadBar = () => { {mounted ? ( arg === '-t'); - const gists = args.some((arg) => arg === '-g'); - isTest ? test(gists) : pushAlgolia(gists); + isTest ? test() : pushAlgolia(); } main(); diff --git a/scripts/posts/index.mjs b/scripts/posts/index.mjs index daefc70..0fce120 100644 --- a/scripts/posts/index.mjs +++ b/scripts/posts/index.mjs @@ -1,6 +1,7 @@ import path from 'path'; /* @ts-check */ import fs from 'fs/promises'; +import matter from 'gray-matter'; const dataPath = 'content/posts'; @@ -15,8 +16,9 @@ const postLists = async () => { const myPosts = []; const getFiles = async (f) => { - const content = await fs.readFile(path.join(dataPath, f), 'utf-8'); - // const { content: meta, content } = matter(markdownWithMeta); + const markdownWithMeta = await fs.readFile(path.join(dataPath, f), 'utf-8'); + const { content, data: meta } = matter(markdownWithMeta); + // console.log('meta', meta); const slug = f.replace(/\.mdx$/, ''); const regex = /^#{2,3}(?!#)(.*)/gm; @@ -40,6 +42,7 @@ const postLists = async () => { type: `lvl${level}`, objectID: url, url, + tag: meta.tags, }; switch (level) {