Skip to content

Commit e1ac538

Browse files
waldekmastykarzCopilot
andcommitted
Upgrades site to Astro@6
Co-authored-by: Copilot <copilot@github.com>
1 parent 4d032f5 commit e1ac538

8 files changed

Lines changed: 271 additions & 1085 deletions

File tree

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@astrojs/rss": "4.0.18",
1414
"@microsoft/clarity": "^1.0.2",
1515
"@tailwindcss/vite": "4.2.2",
16-
"astro": "5.18.0",
16+
"astro": "^6.1.7",
1717
"astro-consent": "2.0.0",
1818
"tailwindcss": "4.2.1"
1919
},

src/components/SampleGallery.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const { samples } = Astro.props;
3131
<div id="sample-grid" class="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
3232
{samples.map((sample) => (
3333
<a
34-
href={`${import.meta.env.BASE_URL}samples/${sample.id.replace(/\.md$/, '')}/`}
34+
href={`${import.meta.env.BASE_URL}samples/${sample.id}/`}
3535
class="sample-card group rounded-2xl border transition-all duration-300 hover:border-purple-500/50 hover:shadow-[0_0_40px_rgba(168,85,247,0.08)] flex flex-col overflow-hidden"
3636
style="background: var(--bg-secondary); border-color: var(--border-primary);"
3737
data-title={sample.data.title.toLowerCase()}

src/content.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { defineCollection, z } from 'astro:content';
1+
import { defineCollection } from 'astro:content';
2+
import { glob } from 'astro/loaders';
3+
import { z } from 'astro/zod';
24

35
const blog = defineCollection({
4-
type: 'content',
6+
loader: glob({ pattern: '**/*.md', base: './src/content/blog' }),
57
schema: z.object({
68
title: z.string(),
79
description: z.string(),
@@ -13,7 +15,7 @@ const blog = defineCollection({
1315
});
1416

1517
const samples = defineCollection({
16-
type: 'content',
18+
loader: glob({ pattern: '**/*.md', base: './src/content/samples' }),
1719
schema: z.object({
1820
name: z.string(),
1921
source: z.string().optional(),

src/pages/blog/[slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getCollection, render } from 'astro:content';
55
export async function getStaticPaths() {
66
const posts = await getCollection('blog');
77
return posts.map((post) => ({
8-
params: { slug: post.id.replace(/\.md$/, '') },
8+
params: { slug: post.id },
99
props: { post },
1010
}));
1111
}

src/pages/blog/index.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const olderPosts = posts.slice(1);
2828
<section class="px-4 pb-16">
2929
<div class="max-w-5xl mx-auto">
3030
<a
31-
href={`${import.meta.env.BASE_URL}blog/${latestPost.id.replace(/\.md$/, '')}/`}
31+
href={`${import.meta.env.BASE_URL}blog/${latestPost.id}/`}
3232
class="group block rounded-2xl border overflow-hidden transition-all duration-300 hover:border-purple-500/50 hover:shadow-[0_0_40px_rgba(168,85,247,0.08)]"
3333
style="background: var(--bg-secondary); border-color: var(--border-primary);"
3434
>
@@ -70,7 +70,7 @@ const olderPosts = posts.slice(1);
7070
<div class="grid md:grid-cols-2 gap-6">
7171
{olderPosts.map((post) => (
7272
<a
73-
href={`${import.meta.env.BASE_URL}blog/${post.id.replace(/\.md$/, '')}/`}
73+
href={`${import.meta.env.BASE_URL}blog/${post.id}/`}
7474
class="group block rounded-2xl border overflow-hidden transition-all duration-300 hover:border-purple-500/50 hover:shadow-[0_0_40px_rgba(168,85,247,0.08)] flex flex-col"
7575
style="background: var(--bg-secondary); border-color: var(--border-primary);"
7676
>

src/pages/rss.xml.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export async function GET(context: APIContext) {
1616
description: post.data.description,
1717
pubDate: post.data.date,
1818
author: post.data.author,
19-
link: `${import.meta.env.BASE_URL}blog/${post.id.replace(/\.md$/, '')}/`,
19+
link: `${import.meta.env.BASE_URL}blog/${post.id}/`,
2020
})),
2121
});
2222
}

src/pages/samples/[slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getCollection, render } from 'astro:content';
55
export async function getStaticPaths() {
66
const samples = await getCollection('samples');
77
return samples.map((sample) => ({
8-
params: { slug: sample.id.replace(/\.md$/, '') },
8+
params: { slug: sample.id },
99
props: { sample },
1010
}));
1111
}

0 commit comments

Comments
 (0)