Skip to content

Commit 165b32f

Browse files
committed
chore: astro 5 & other deps
1 parent 6dfd2b2 commit 165b32f

16 files changed

Lines changed: 1386 additions & 2172 deletions

package-lock.json

Lines changed: 1321 additions & 2126 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,26 @@
2828
"astro": "astro"
2929
},
3030
"dependencies": {
31-
"@astrojs/check": "^0.9.6",
32-
"@astrojs/mdx": "^4.3.0",
33-
"@astrojs/preact": "^4.1.0",
34-
"@astrojs/rss": "^4.0.0",
35-
"@astrojs/sitemap": "^3.6.0",
36-
"@notionhq/client": "^5.6.0",
31+
"@astrojs/check": "^0.9.8",
32+
"@astrojs/mdx": "^5.0.3",
33+
"@astrojs/preact": "^5.1.0",
34+
"@astrojs/rss": "^4.0.18",
35+
"@astrojs/sitemap": "^3.7.2",
36+
"@notionhq/client": "^5.15.0",
3737
"@tailwindcss/typography": "^0.5.19",
38-
"@tailwindcss/vite": "^4.1.17",
38+
"@tailwindcss/vite": "^4.2.2",
3939
"@types/jsonld": "^1.5.15",
40-
"@vercel/og": "^0.6.4",
41-
"astro": "^5.16.0",
42-
"astro-expressive-code": "^0.41.4",
40+
"@vercel/og": "^0.11.1",
41+
"astro": "^6.1.1",
42+
"astro-expressive-code": "^0.41.7",
4343
"notion-to-md": "^3.1.9",
44-
"preact": "^10.25.1",
45-
"tailwindcss": "^4.1.17",
46-
"typescript": "^5.9.0"
44+
"preact": "^10.29.0",
45+
"tailwindcss": "^4.2.2",
46+
"typescript": "^5.9.3"
4747
},
4848
"devDependencies": {
49-
"@biomejs/biome": "2.3.10",
50-
"prettier": "^3.7.4",
49+
"@biomejs/biome": "2.4.9",
50+
"prettier": "^3.8.1",
5151
"tsx": "^4.19.2"
5252
}
5353
}

src/components/BlogCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const { post, firstBigger = true, showDate = true } = Astro.props
1616

1717
<a
1818
title={post.data.title}
19-
href={`/blog/${post.slug}/`}
19+
href={`/blog/${post.id}/`}
2020
class:list={[
2121
'ease flex flex-col rounded-lg bg-white transition duration-300 dark:bg-gray-500',
2222
'hover:translate-y-0.5 shadow-md hover:shadow-xl',

src/components/ProjectCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { Image } from 'astro:assets'
2+
import { Image } from 'astro:assets'
33
import GithubIcon from './icons/Github'
44
55
interface Props {

src/components/RecipeCard.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const { recipe } = Astro.props
1111

1212
<a
1313
title={recipe.data.title}
14-
href={`/recipes/${recipe.slug}/`}
14+
href={`/recipes/${recipe.id}/`}
1515
class="ease flex flex-col rounded-lg bg-white transition duration-300 dark:bg-gray-500
1616
hover:translate-y-0.5 shadow-md hover:shadow-xl group"
1717
>
Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
import { defineCollection, z } from 'astro:content'
1+
import { defineCollection } from 'astro:content'
2+
import { glob } from 'astro/loaders'
3+
import { z } from 'zod'
24

35
const blog = defineCollection({
4-
type: 'content',
6+
loader: glob({
7+
pattern: '**/*.{md,mdx}',
8+
base: './src/content/blog',
9+
generateId: ({ entry }) =>
10+
entry.replace(/\/index\.(md|mdx)$/, '').replace(/\.(md|mdx)$/, ''),
11+
}),
512
schema: ({ image }) =>
613
z.object({
714
title: z.string(),
815
description: z.string().optional(),
9-
date: z.coerce.date(), // Transform string to Date object
16+
date: z.coerce.date(),
1017
cover: image(),
1118
language: z.string().optional(),
1219
modified: z.coerce.date().optional(),
@@ -26,7 +33,14 @@ const blog = defineCollection({
2633
})
2734

2835
const pages = defineCollection({
29-
type: 'content',
36+
loader: glob({
37+
pattern: '**/*.{md,mdx}',
38+
base: './src/content/pages',
39+
generateId: ({ entry, data }) => {
40+
if (data.slug && typeof data.slug === 'string') return data.slug
41+
return entry.replace(/\/index\.(md|mdx)$/, '').replace(/\.(md|mdx)$/, '')
42+
},
43+
}),
3044
schema: ({ image }) =>
3145
z.object({
3246
title: z.string(),
@@ -37,11 +51,16 @@ const pages = defineCollection({
3751
})
3852

3953
const recipes = defineCollection({
40-
type: 'content',
54+
loader: glob({
55+
pattern: '**/*.{md,mdx}',
56+
base: './src/content/recipes',
57+
generateId: ({ entry }) =>
58+
entry.replace(/\/index\.(md|mdx)$/, '').replace(/\.(md|mdx)$/, ''),
59+
}),
4160
schema: ({ image }) =>
4261
z.object({
4362
title: z.string(),
44-
date: z.coerce.date(), // Transform string to Date object
63+
date: z.coerce.date(),
4564
cover: image(),
4665
description: z.string().optional(),
4766
}),

src/content/pages/speaking/MyTalks.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ function Presentations(): JSX.Element {
6868
)
6969
}
7070

71-
export { Talks, TrainingsAndWorkshops, Presentations }
71+
export { Presentations, Talks, TrainingsAndWorkshops }

src/layouts/BlogPost.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function formatBlogTranslation(
2929
)
3030
}
3131
32-
const { data, slug } = Astro.props
32+
const { data, id: slug } = Astro.props
3333
const {
3434
title,
3535
description,

src/layouts/Page.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PageTitle from '../components/PageTitle.astro'
66
77
type Props = CollectionEntry<'pages'> | CollectionEntry<'recipes'>
88
9-
const { data, slug } = Astro.props
9+
const { data, id: slug } = Astro.props
1010
const { title, cover, description } = data
1111
---
1212

src/pages/[...slug].astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
---
2-
import { type CollectionEntry, getCollection } from 'astro:content'
2+
import { type CollectionEntry, getCollection, render } from 'astro:content'
33
import Prose from '../components/Prose.astro'
44
import Page from '../layouts/Page.astro'
55
66
export async function getStaticPaths() {
77
const pages = await getCollection('pages')
88
return pages.map(page => ({
9-
params: { slug: page.slug },
9+
params: { slug: page.id },
1010
props: page,
1111
}))
1212
}
1313
type Props = CollectionEntry<'pages'>
1414
1515
const page = Astro.props
16-
const { Content } = await page.render()
16+
const { Content } = await render(page)
1717
---
1818

1919
<Page {...page}>

0 commit comments

Comments
 (0)