add draft label
This commit is contained in:
parent
6e785284f2
commit
1adcfa0cbd
3 changed files with 6 additions and 3 deletions
2
index.ts
2
index.ts
|
|
@ -65,6 +65,7 @@ await Promise.all(posts.map(async (post) => {
|
||||||
: TRACKER_HEADER)
|
: TRACKER_HEADER)
|
||||||
.replaceAll("[[TITLE]]", `${metadata.title} - ${frontmatter.title}`)
|
.replaceAll("[[TITLE]]", `${metadata.title} - ${frontmatter.title}`)
|
||||||
.replaceAll("[[POST_TITLE]]", frontmatter.title)
|
.replaceAll("[[POST_TITLE]]", frontmatter.title)
|
||||||
|
.replaceAll("[[SHOW_DRAFT]]", frontmatter.draft ? "inline" : "hidden")
|
||||||
.replaceAll("[[DATE]]", frontmatter.date.toDateString())
|
.replaceAll("[[DATE]]", frontmatter.date.toDateString())
|
||||||
.replaceAll("[[DESC]]", frontmatter.desc)
|
.replaceAll("[[DESC]]", frontmatter.desc)
|
||||||
.replace("[[CONTENT]]", html);
|
.replace("[[CONTENT]]", html);
|
||||||
|
|
@ -87,7 +88,6 @@ const parsedPosts = postLinks
|
||||||
.join("\n");
|
.join("\n");
|
||||||
const render = home
|
const render = home
|
||||||
.replace("[[ABOUT]]", Bun.markdown.html(metadata.description))
|
.replace("[[ABOUT]]", Bun.markdown.html(metadata.description))
|
||||||
.replace("[[MAIN]]", metadata.main)
|
|
||||||
.replace("[[POSTS]]", parsedPosts);
|
.replace("[[POSTS]]", parsedPosts);
|
||||||
|
|
||||||
await Bun.write("./dist/index.html", render);
|
await Bun.write("./dist/index.html", render);
|
||||||
|
|
|
||||||
2
posts
2
posts
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6ddb36d446ca999d389a8c9578bd5b0c56ec3472
|
Subproject commit f576f729fa2b24b0a98e6d25d0a955731d25de1d
|
||||||
|
|
@ -34,7 +34,10 @@
|
||||||
</header>
|
</header>
|
||||||
<main class="my-6">
|
<main class="my-6">
|
||||||
<h1 class="text-4xl font-bold">[[POST_TITLE]]</h1>
|
<h1 class="text-4xl font-bold">[[POST_TITLE]]</h1>
|
||||||
<span class="text-ctp-subtext0 italic block mb-10">[[DATE]]</span>
|
<span class="text-ctp-subtext0 italic block mb-10">
|
||||||
|
[[DATE]]
|
||||||
|
<span class="text-ctp-yellow [[SHOW_DRAFT]]">(unlisted: marked as draft)</span>
|
||||||
|
</span>
|
||||||
[[CONTENT]]
|
[[CONTENT]]
|
||||||
</main>
|
</main>
|
||||||
<footer>
|
<footer>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue