Skip to content

Commit 7a588e9

Browse files
authored
Upgrade to Astro 6 (#273)
* Migrate content collections * Format code * Fix content collections
1 parent 6930b54 commit 7a588e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+56
-49
lines changed

bun.lockb

-15 KB
Binary file not shown.

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"lint": "bunx --bun prettier . --check"
1313
},
1414
"dependencies": {
15-
"@astrojs/react": "3.6.2",
15+
"@astrojs/react": "4.0.0",
1616
"@iconify-json/bi": "^1.2.1",
1717
"@iconify-json/cil": "^1.2.1",
1818
"@iconify-json/fluent": "^1.2.7",
@@ -28,26 +28,27 @@
2828
"@iconify-json/uiw": "^1.2.1",
2929
"@types/react": "^18.3.12",
3030
"@types/react-dom": "^18.3.1",
31-
"astro": "4.16.13",
32-
"astro-icon": "1.1.2",
33-
"astro-purgecss": "4.8.0",
31+
"astro": "5.0.4",
32+
"astro-icon": "1.1.4",
33+
"astro-purgecss": "5.0.0",
3434
"autoprefixer": "^10.4.20",
3535
"date-fns": "^4.1.0",
3636
"mermaid": "11.4.0",
3737
"postcss-nested": "^7.0.2",
38-
"purgecss": "^6.0.0",
38+
"purgecss": "^7.0.0",
3939
"react": "^18.3.1",
4040
"react-dom": "^18.3.1",
4141
"sharp": "^0.33.5",
4242
"styled-components": "^6.1.13"
4343
},
4444
"devDependencies": {
4545
"@mermaid-js/mermaid-cli": "11.4.0",
46-
"prettier": "3.3.3",
46+
"prettier": "3.4.2",
4747
"prettier-plugin-astro": "0.14.1",
48-
"vite-plugin-fable": "^0.0.31"
48+
"vite-plugin-fable": "^0.0.32"
4949
},
5050
"trustedDependencies": [
51+
"astro",
5152
"sharp",
5253
"vite-plugin-fable"
5354
]

src/content/blog/BobKonf2024.md renamed to src/blog/BobKonf2024.md

Lines changed: 2 additions & 2 deletions

src/content/blog/DataScienceConf2023.md renamed to src/blog/DataScienceConf2023.md

Lines changed: 2 additions & 2 deletions

src/content/blog/FSharpFormattingTwenty.md renamed to src/blog/FSharpFormattingTwenty.md

Lines changed: 3 additions & 3 deletions

src/content/blog/HingGracefully.md renamed to src/blog/HingGracefully.md

Lines changed: 3 additions & 3 deletions

src/content/blog/PortingFsih.md renamed to src/blog/PortingFsih.md

Lines changed: 6 additions & 6 deletions

src/content/blog/SwitchPackageToProjRef.md renamed to src/blog/SwitchPackageToProjRef.md

Lines changed: 1 addition & 1 deletion

src/content/config.ts renamed to src/content.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
// 1. Import utilities from `astro:content`
1+
// 1. Import utilities from `astro:content`
22
import { z, defineCollection } from "astro:content";
3+
import { glob } from "astro/loaders";
4+
35
// 2. Define your collection(s)
46
const testimonialCollection = defineCollection({
7+
loader: glob({ pattern: "*.md", base: "./src/testimonials" }),
58
schema: ({ image }) =>
69
z.object({
710
title: z.string(),
@@ -13,6 +16,7 @@ const testimonialCollection = defineCollection({
1316
});
1417

1518
const sessionCollection = defineCollection({
19+
loader: glob({ pattern: "*.md", base: "./src/sessions" }),
1620
schema: ({ image }) => {
1721
return z.object({
1822
title: z.string(),
@@ -32,6 +36,7 @@ const sessionCollection = defineCollection({
3236
});
3337

3438
const blogCollection = defineCollection({
39+
loader: glob({ pattern: "*.md", base: "./src/blog" }),
3540
schema: ({ image }) => {
3641
return z.object({
3742
title: z.string(),

src/pages/testimonials/[...slug].astro renamed to src/pages/testimonials/[...id].astro

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import { getCollection } from "astro:content";
2+
import { getCollection, render } from "astro:content";
33
import PageLayout from "../../layouts/PageLayout.astro";
44
55
export async function getStaticPaths() {
@@ -9,14 +9,14 @@ export async function getStaticPaths() {
99
const prevTestimonial = testimonialsEntries.at(
1010
(index - 1) % testimonialsEntries.length,
1111
);
12-
const prevLink = prevTestimonial && prevTestimonial.slug;
12+
const prevLink = prevTestimonial && prevTestimonial.id;
1313
const nextTestimonial = testimonialsEntries.at(
1414
(index + 1) % testimonialsEntries.length,
1515
);
16-
const nextLink = nextTestimonial && nextTestimonial.slug;
16+
const nextLink = nextTestimonial && nextTestimonial.id;
1717
1818
return {
19-
params: { slug: entry.slug },
19+
params: { id: entry.id },
2020
props: {
2121
entry,
2222
prevLink,
@@ -28,7 +28,7 @@ export async function getStaticPaths() {
2828
}
2929
3030
const { entry, prevLink, nextLink, color } = Astro.props;
31-
const { Content } = await entry.render();
31+
const { Content } = await render(entry);
3232
const { title, author, profilePicture } = entry.data;
3333
const pageTitle = `Testimonial of ${title}`;
3434
const mainTitle = pageTitle;

0 commit comments

Comments
 (0)