feat: update schema, add ProjectCard
, readme
This commit is contained in:
parent
fbeab5a744
commit
b93eddea6b
24 changed files with 373 additions and 72 deletions
BIN
src/content/blog/2022-post/2022.png
Normal file
BIN
src/content/blog/2022-post/2022.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: '2022 Post'
|
||||
description: 'This a dummy post written in the year 2022.'
|
||||
date: '2022-01-01'
|
||||
date: 2022-01-01
|
||||
tags: ['dummy', 'placeholder']
|
||||
image: '/static/1200x630.png'
|
||||
image: './2022.png'
|
||||
---
|
||||
|
||||
This is a dummy post written in the year 2022.
|
BIN
src/content/blog/2023-post/2023.png
Normal file
BIN
src/content/blog/2023-post/2023.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 92 KiB |
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: '2023 Post'
|
||||
description: 'This a dummy post written in the year 2023.'
|
||||
date: '2023-01-01'
|
||||
date: 2023-01-01
|
||||
tags: ['dummy', 'placeholder']
|
||||
image: '/static/1200x630.png'
|
||||
image: './2023.png'
|
||||
authors: ['enscribe']
|
||||
---
|
||||
|
BIN
src/content/blog/2024-post/2024.png
Normal file
BIN
src/content/blog/2024-post/2024.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 93 KiB |
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: '2024 Post'
|
||||
description: 'This a dummy post written in the year 2024 (with multiple authors).'
|
||||
date: '2024-01-01'
|
||||
date: 2024-01-01
|
||||
tags: ['dummy', 'placeholder']
|
||||
image: '/static/1200x630.png'
|
||||
image: './2024.png'
|
||||
authors: ['enscribe', 'jktrn']
|
||||
---
|
||||
|
BIN
src/content/blog/the-state-of-static-blogs/1200x630.png
Normal file
BIN
src/content/blog/the-state-of-static-blogs/1200x630.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 77 KiB |
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: 'The State of Static Blogs in 2024'
|
||||
description: 'There should not be a single reason why you would need a command palette search bar to find a blog post on your own site.'
|
||||
date: '2024-07-25'
|
||||
date: 2024-07-25
|
||||
tags: ['webdev', 'opinion']
|
||||
image: '/static/1200x630.png'
|
||||
image: './1200x630.png'
|
||||
authors: ['enscribe']
|
||||
---
|
||||
|
|
@ -2,15 +2,31 @@ import { defineCollection, z } from 'astro:content'
|
|||
|
||||
const blog = defineCollection({
|
||||
type: 'content',
|
||||
schema: z.object({
|
||||
title: z.string(),
|
||||
description: z.string(),
|
||||
date: z.coerce.date(),
|
||||
draft: z.boolean().optional(),
|
||||
image: z.string().optional(),
|
||||
tags: z.array(z.string()).optional(),
|
||||
authors: z.array(z.string()).optional(),
|
||||
}),
|
||||
schema: ({ image }) =>
|
||||
z.object({
|
||||
title: z
|
||||
.string()
|
||||
.max(
|
||||
60,
|
||||
'Title should be 60 characters or less for optimal Open Graph display.',
|
||||
),
|
||||
description: z
|
||||
.string()
|
||||
.max(
|
||||
155,
|
||||
'Description should be 155 characters or less for optimal Open Graph display.',
|
||||
),
|
||||
date: z.coerce.date(),
|
||||
image: image()
|
||||
.refine((img) => img.width === 1200 && img.height === 630, {
|
||||
message:
|
||||
'The image must be exactly 1200px × 630px for Open Graph requirements.',
|
||||
})
|
||||
.optional(),
|
||||
tags: z.array(z.string()).optional(),
|
||||
authors: z.array(z.string()).optional(),
|
||||
draft: z.boolean().optional(),
|
||||
}),
|
||||
})
|
||||
|
||||
const authors = defineCollection({
|
||||
|
@ -20,13 +36,28 @@ const authors = defineCollection({
|
|||
pronouns: z.string().optional(),
|
||||
avatar: z.string().url(),
|
||||
bio: z.string().optional(),
|
||||
website: z.string().url().optional(),
|
||||
twitter: z.string().optional(),
|
||||
github: z.string().optional(),
|
||||
linkedin: z.string().optional(),
|
||||
mail: z.string().email().optional(),
|
||||
discord: z.string().optional(),
|
||||
website: z.string().url().optional(),
|
||||
twitter: z.string().url().optional(),
|
||||
github: z.string().url().optional(),
|
||||
linkedin: z.string().url().optional(),
|
||||
discord: z.string().url().optional(),
|
||||
}),
|
||||
})
|
||||
|
||||
export const collections = { blog, authors }
|
||||
const projects = defineCollection({
|
||||
type: 'content',
|
||||
schema: ({ image }) =>
|
||||
z.object({
|
||||
name: z.string(),
|
||||
description: z.string(),
|
||||
tags: z.array(z.string()),
|
||||
image: image().refine((img) => img.width === 1200 && img.height === 630, {
|
||||
message:
|
||||
'The image must be exactly 1200px × 630px for Open Graph requirements.',
|
||||
}),
|
||||
link: z.string().url(),
|
||||
}),
|
||||
})
|
||||
|
||||
export const collections = { blog, authors, projects }
|
||||
|
|
7
src/content/projects/project-a.md
Normal file
7
src/content/projects/project-a.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
name: "Project A"
|
||||
description: "This is an example project description! You should replace this with a description of your own project."
|
||||
tags: ["Framework A", "Library B", "Tool C", "Resource D"]
|
||||
image: "../../../public/static/1200x630.png"
|
||||
link: "https://example.com"
|
||||
---
|
7
src/content/projects/project-b.md
Normal file
7
src/content/projects/project-b.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
name: "Project B"
|
||||
description: "This is an example project description! You should replace this with a description of your own project."
|
||||
tags: ["Framework A", "Library B", "Tool C", "Resource D"]
|
||||
image: "../../../public/static/1200x630.png"
|
||||
link: "https://example.com"
|
||||
---
|
7
src/content/projects/project-c.md
Normal file
7
src/content/projects/project-c.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
name: "Project C"
|
||||
description: "This is an example project description! You should replace this with a description of your own project."
|
||||
tags: ["Framework A", "Library B", "Tool C", "Resource D"]
|
||||
image: "../../../public/static/1200x630.png"
|
||||
link: "https://example.com"
|
||||
---
|
Loading…
Add table
Add a link
Reference in a new issue