add draft label

This commit is contained in:
Satria 2026-07-14 15:31:22 +07:00
commit 1adcfa0cbd
3 changed files with 6 additions and 3 deletions

View file

@ -65,6 +65,7 @@ await Promise.all(posts.map(async (post) => {
: TRACKER_HEADER)
.replaceAll("[[TITLE]]", `${metadata.title} - ${frontmatter.title}`)
.replaceAll("[[POST_TITLE]]", frontmatter.title)
.replaceAll("[[SHOW_DRAFT]]", frontmatter.draft ? "inline" : "hidden")
.replaceAll("[[DATE]]", frontmatter.date.toDateString())
.replaceAll("[[DESC]]", frontmatter.desc)
.replace("[[CONTENT]]", html);
@ -87,7 +88,6 @@ const parsedPosts = postLinks
.join("\n");
const render = home
.replace("[[ABOUT]]", Bun.markdown.html(metadata.description))
.replace("[[MAIN]]", metadata.main)
.replace("[[POSTS]]", parsedPosts);
await Bun.write("./dist/index.html", render);