Add Docker Build Support
Blog posts with 'draft: true' in the frontmatter are excluded from the production artifact --no-cache docker builds ensure fresh database build each time. Caching isn't needed do to small size anyway
This commit is contained in:
@@ -14,6 +14,11 @@ import { dbConnection } from "../src/db";
|
||||
const {data, content } = matter(await Bun.file(`./content/${file}`).text());
|
||||
const route = `/${file.replace(/\.md$/, "")}`;
|
||||
|
||||
// Omit draft blog posts from database initialization in production
|
||||
if (process.env.NODE_ENV === 'build' && data.draft) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Remove the title from content if it matches the frontmatter title to avoid duplicate H1s
|
||||
let processedContent = content;
|
||||
if (data.title) {
|
||||
|
||||
Reference in New Issue
Block a user