Compare commits
4 commits
2ed5ea840c
...
79c2ea5444
| Author | SHA1 | Date | |
|---|---|---|---|
| 79c2ea5444 | |||
| 7953835eec | |||
| 1adcfa0cbd | |||
| 6e785284f2 |
7 changed files with 12 additions and 10 deletions
|
|
@ -31,6 +31,8 @@ jobs:
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: bun run build
|
run: bun run build
|
||||||
|
env:
|
||||||
|
NODE_ENV: production
|
||||||
|
|
||||||
- name: Deploy to Cloudflare Workers
|
- name: Deploy to Cloudflare Workers
|
||||||
run: bunx wrangler deploy --assets=./dist
|
run: bunx wrangler deploy --assets=./dist
|
||||||
|
|
|
||||||
2
bun.lock
2
bun.lock
|
|
@ -12,7 +12,7 @@
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "^5",
|
"typescript": "^5 || ^7.0.0",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
6
index.ts
6
index.ts
|
|
@ -65,8 +65,8 @@ 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("[[REVISIONS]]", `${metadata.revisions}/${post}`)
|
|
||||||
.replaceAll("[[DESC]]", frontmatter.desc)
|
.replaceAll("[[DESC]]", frontmatter.desc)
|
||||||
.replace("[[CONTENT]]", html);
|
.replace("[[CONTENT]]", html);
|
||||||
|
|
||||||
|
|
@ -78,8 +78,7 @@ await Promise.all(posts.map(async (post) => {
|
||||||
link: `/posts/${post.replace(".md", ".html")}`,
|
link: `/posts/${post.replace(".md", ".html")}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`Built page for ${frontmatter.draft ? 'draft' : 'post'}: ${frontmatter.title}`);
|
if (process.env.NODE_ENV !== "production") console.log(`Built page for ${frontmatter.draft ? 'draft' : 'post'}: ${frontmatter.title}`);
|
||||||
// TODO: table of contents generation
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const parsedPosts = postLinks
|
const parsedPosts = postLinks
|
||||||
|
|
@ -88,7 +87,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,6 +2,5 @@
|
||||||
"title": "satr14's mind",
|
"title": "satr14's mind",
|
||||||
"name": "satr14",
|
"name": "satr14",
|
||||||
"description": "Welcome to my 2nd over-engineered corner of the Interwebs! I'm Satria, Im a self-taught hobbyist web developer and homelaber sysadmin from Indonesia. I've been programming since 2021 and spend my free time working on personal projects.\n\nThis blog is where I share my thoughts, projects, experiences, tutorials, and just about anything I feel like sharing. Have any corrections, suggestions, or just wanna chat? Feel free to send an [email](mailto:admin@satr14.my.id) or contact me on other [platforms](https://satr14.my.id).",
|
"description": "Welcome to my 2nd over-engineered corner of the Interwebs! I'm Satria, Im a self-taught hobbyist web developer and homelaber sysadmin from Indonesia. I've been programming since 2021 and spend my free time working on personal projects.\n\nThis blog is where I share my thoughts, projects, experiences, tutorials, and just about anything I feel like sharing. Have any corrections, suggestions, or just wanna chat? Feel free to send an [email](mailto:admin@satr14.my.id) or contact me on other [platforms](https://satr14.my.id).",
|
||||||
"timezone": "Asia/Jakarta",
|
"timezone": "Asia/Jakarta"
|
||||||
"revisions": "https://git.satr14.my.id/satr14/ssg.md/commits/branch/main/posts"
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
"@types/bun": "latest"
|
"@types/bun": "latest"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "^5"
|
"typescript": "^5 || ^7.0.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@catppuccin/tailwindcss": "^1.0.0",
|
"@catppuccin/tailwindcss": "^1.0.0",
|
||||||
|
|
|
||||||
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]] - <a href="[[REVISIONS]]">view revisions</a></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