mirror of
https://github.com/timmypidashev/web.git
synced 2026-04-14 02:53:51 +00:00
Omit drafts from build
This commit is contained in:
@@ -5,4 +5,5 @@ author: Timothy Pidashev
|
|||||||
tags: ["uefi", "coreboot", "firmware", "chromebooks"]
|
tags: ["uefi", "coreboot", "firmware", "chromebooks"]
|
||||||
date: 2025-09-15
|
date: 2025-09-15
|
||||||
image: "/blog/breaking-the-chromebook-cage/thumbnail.png"
|
image: "/blog/breaking-the-chromebook-cage/thumbnail.png"
|
||||||
|
isDraft: true
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ author: Timothy Pidashev
|
|||||||
tags: [t440p, coreboot, thinkpad]
|
tags: [t440p, coreboot, thinkpad]
|
||||||
date: 2025-01-15
|
date: 2025-01-15
|
||||||
image: "/blog/thinkpad-t440p-coreboot-guide/thumbnail.png"
|
image: "/blog/thinkpad-t440p-coreboot-guide/thumbnail.png"
|
||||||
|
isDraft: true
|
||||||
---
|
---
|
||||||
|
|
||||||
import { Commands, Command, CommandSequence } from "@/components/mdx/command";
|
import { Commands, Command, CommandSequence } from "@/components/mdx/command";
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export const collections = {
|
|||||||
}),
|
}),
|
||||||
image: z.string().optional(),
|
image: z.string().optional(),
|
||||||
imagePosition: z.string().optional(),
|
imagePosition: z.string().optional(),
|
||||||
|
isDraft: z.boolean().optional()
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
projects: defineCollection({
|
projects: defineCollection({
|
||||||
@@ -22,7 +23,7 @@ export const collections = {
|
|||||||
demoUrl: z.string().url().optional(),
|
demoUrl: z.string().url().optional(),
|
||||||
techStack: z.array(z.string()),
|
techStack: z.array(z.string()),
|
||||||
date: z.string(),
|
date: z.string(),
|
||||||
image: z.string().optional(),
|
image: z.string().optional()
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ const { slug } = Astro.params;
|
|||||||
const posts = await getCollection("blog");
|
const posts = await getCollection("blog");
|
||||||
const post = posts.find(post => post.slug === slug);
|
const post = posts.find(post => post.slug === slug);
|
||||||
|
|
||||||
if (!post) {
|
if (!post || post.data.isDraft === true) {
|
||||||
return new Response(null, {
|
return new Response(null, {
|
||||||
status: 404,
|
status: 404,
|
||||||
statusText: 'Not found'
|
statusText: "Not found"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user