Add cover images for posts

This commit is contained in:
thiloho
2023-05-22 22:27:49 +02:00
parent edd95984f0
commit 029222bb03
18 changed files with 134 additions and 80 deletions

View File

@@ -1,8 +1,3 @@
---
title: "aurora"
description: "Minimalistic blog theme built with Astro, focused on accessibility and usability."
---
## About
aurora is a minimal blog theme built with Astro, Svelte and plain CSS. It is focused on accessibility and usability.

View File

@@ -1,4 +1,6 @@
---
cover: "../../assets/blog/build-a-good-website/cover.jpg"
coverAlt: "Cover image for the blog post"
title: "Build a good website"
publicationDate: 2023-05-07
description: "Learn to create and publish a performant, accessible and SEO friendly website."

View File

@@ -1,4 +1,6 @@
---
cover: "../../assets/blog/markdown-style-guide/cover.jpg"
coverAlt: "Cover image for the blog post"
title: "Markdown style guide"
publicationDate: 2023-05-20
description: "Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro."

View File

@@ -1,4 +1,6 @@
---
cover: "../../assets/blog/nix-flake-examples/cover.jpg"
coverAlt: "Cover image for the blog post"
title: "Nix flake examples"
publicationDate: 2023-05-12
description: "Improve reproducibility, composability and usability of nix-based projects with flakes and the experimental cli commands."

View File

@@ -1,18 +1,15 @@
import { z, defineCollection } from "astro:content";
export const collections = {
home: defineCollection({
schema: z.object({
title: z.string(),
description: z.string(),
}),
}),
blog: defineCollection({
schema: z.object({
schema: ({ image }) => z.object({
cover: image().refine((img) => img.width >= 1080, {
message: "Cover image must be at least 1080 pixels wide!",
}),
coverAlt: z.string(),
title: z.string(),
publicationDate: z.date(),
description: z.string(),
workInProgress: z.boolean().default(false),
}),
}),
};