Skip to content

Commit 953c4f2

Browse files
committed
Migrate to astro v5 beta: first round
1 parent 52188af commit 953c4f2

13 files changed

+387
-1184
lines changed

package-lock.json

+361-1,156
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+15-16
Original file line numberDiff line numberDiff line change
@@ -23,47 +23,46 @@
2323
},
2424
"dependencies": {
2525
"@astrojs/rss": "^4.0.7",
26-
"@astrojs/sitemap": "^3.1.6",
27-
"@astrolib/analytics": "^0.5.0",
28-
"@astrolib/seo": "^1.0.0-beta.6",
26+
"@astrojs/sitemap": "^3.2.0",
27+
"@astrolib/analytics": "^0.6.1",
28+
"@astrolib/seo": "^1.0.0-beta.8",
2929
"@fontsource-variable/inter": "^5.1.0",
30-
"astro": "^4.15.5",
31-
"astro-embed": "^0.7.2",
30+
"astro": "^5.0.0-beta.3",
3231
"astro-icon": "^1.1.1",
3332
"limax": "4.1.0",
3433
"lodash.merge": "^4.6.2",
3534
"unpic": "^3.18.0"
3635
},
3736
"devDependencies": {
3837
"@astrojs/check": "^0.9.3",
39-
"@astrojs/mdx": "^3.1.6",
38+
"@astrojs/mdx": "^4.0.0-beta.2",
4039
"@astrojs/partytown": "^2.1.2",
41-
"@astrojs/tailwind": "5.1.0",
42-
"@eslint/js": "^9.10.0",
40+
"@astrojs/tailwind": "^5.1.1",
41+
"@eslint/js": "^9.11.1",
4342
"@iconify-json/flat-color-icons": "^1.2.0",
44-
"@iconify-json/tabler": "^1.2.3",
43+
"@iconify-json/tabler": "^1.2.4",
4544
"@tailwindcss/typography": "^0.5.15",
4645
"@types/eslint__js": "^8.42.3",
4746
"@types/js-yaml": "^4.0.9",
4847
"@types/lodash.merge": "^4.6.9",
4948
"@types/mdx": "^2.0.13",
50-
"@typescript-eslint/eslint-plugin": "^8.6.0",
51-
"@typescript-eslint/parser": "^8.6.0",
49+
"@typescript-eslint/eslint-plugin": "^8.8.0",
50+
"@typescript-eslint/parser": "^8.8.0",
5251
"astro-compress": "2.3.1",
5352
"astro-eslint-parser": "^1.0.3",
54-
"eslint": "^9.10.0",
53+
"eslint": "^9.11.1",
5554
"eslint-plugin-astro": "^1.2.4",
56-
"globals": "^15.9.0",
55+
"globals": "^15.10.0",
5756
"js-yaml": "^4.1.0",
5857
"mdast-util-to-string": "^4.0.0",
5958
"prettier": "^3.3.3",
6059
"prettier-plugin-astro": "^0.14.1",
6160
"reading-time": "^1.5.0",
6261
"sharp": "0.33.5",
63-
"tailwind-merge": "^2.5.2",
64-
"tailwindcss": "^3.4.11",
62+
"tailwind-merge": "^2.5.3",
63+
"tailwindcss": "^3.4.13",
6564
"typescript": "^5.6.2",
66-
"typescript-eslint": "^8.6.0",
65+
"typescript-eslint": "^8.8.0",
6766
"unist-util-visit": "^5.0.0"
6867
}
6968
}

src/content/config.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { z, defineCollection } from 'astro:content';
2+
import { glob } from 'astro/loaders';
23

34
const metadataDefinition = () =>
45
z
@@ -46,6 +47,7 @@ const metadataDefinition = () =>
4647
.optional();
4748

4849
const postCollection = defineCollection({
50+
loader: glob({ pattern: ['*.md', '*.mdx'], base: 'src/data/post' }),
4951
schema: z.object({
5052
publishDate: z.date().optional(),
5153
updateDate: z.date().optional(),
File renamed without changes.

src/content/post/markdown-elements-demo-post.mdx renamed to src/data/post/markdown-elements-demo-post.mdx

-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ tags:
99
---
1010

1111
import Logo from '~/components/Logo.astro';
12-
import { YouTube, Tweet, Vimeo } from 'astro-embed';
1312

1413
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
1514

@@ -191,14 +190,11 @@ import Logo from "~/components/Logo.astro";
191190

192191
### Youtube
193192

194-
<YouTube id="y9n6HkftavM" />
195193

196194
### Tweet
197195

198-
<Tweet id="https://twitter.com/Steve8708/status/1598713161339015173" />
199196

200197
### Vimeo
201198

202-
<Vimeo id="178430038" />
203199

204200
[[Top]](#top)

src/layouts/Layout.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import Analytics from '~/components/common/Analytics.astro';
1313
import BasicScripts from '~/components/common/BasicScripts.astro';
1414
1515
// Comment the line below to disable View Transitions
16-
import { ViewTransitions } from 'astro:transitions';
16+
import { ClientRouter } from 'astro:transitions';
1717
1818
import type { MetaData as MetaDataType } from '~/types';
1919
@@ -37,7 +37,7 @@ const { language, textDirection } = I18N;
3737
<Analytics />
3838

3939
<!-- Comment the line below to disable View Transitions -->
40-
<ViewTransitions fallback="swap" />
40+
<ClientRouter fallback="swap" />
4141
</head>
4242

4343
<body class="antialiased text-default bg-page tracking-tight">

src/pages/homes/startup.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Features3 from '~/components/widgets/Features3.astro';
1111
import FAQs from '~/components/widgets/FAQs.astro';
1212
import Brands from '~/components/widgets/Brands.astro';
1313
14-
import { YouTube } from 'astro-embed';
14+
// import { YouTube } from 'astro-embed';
1515
1616
const metadata = {
1717
title: 'Startup Landing Page',
@@ -46,7 +46,7 @@ const metadata = {
4646
</Fragment>
4747

4848
<Fragment slot="image">
49-
<YouTube id="gxBkghlglTg" title="Astro just Launched.... Could it be the ultimate web framework?" />
49+
<!-- <YouTube id="gxBkghlglTg" title="Astro just Launched.... Could it be the ultimate web framework?" /> -->
5050
<style is:inline>
5151
lite-youtube {
5252
margin: 0 auto;

src/utils/blog.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { PaginateFunction } from 'astro';
2-
import { getCollection } from 'astro:content';
2+
import { getCollection, render } from 'astro:content';
33
import type { CollectionEntry } from 'astro:content';
44
import type { Post } from '~/types';
55
import { APP_BLOG } from 'astrowind:config';
@@ -41,8 +41,8 @@ const generatePermalink = async ({
4141
};
4242

4343
const getNormalizedPost = async (post: CollectionEntry<'post'>): Promise<Post> => {
44-
const { id, slug: rawSlug = '', data } = post;
45-
const { Content, remarkPluginFrontmatter } = await post.render();
44+
const { id, data } = post;
45+
const { Content, remarkPluginFrontmatter } = await render(post);
4646

4747
const {
4848
publishDate: rawPublishDate = new Date(),
@@ -57,7 +57,7 @@ const getNormalizedPost = async (post: CollectionEntry<'post'>): Promise<Post> =
5757
metadata = {},
5858
} = data;
5959

60-
const slug = cleanSlug(rawSlug); // cleanSlug(rawSlug.split('/').pop());
60+
const slug = cleanSlug(id); // cleanSlug(rawSlug.split('/').pop());
6161
const publishDate = new Date(rawPublishDate);
6262
const updateDate = rawUpdateDate ? new Date(rawUpdateDate) : undefined;
6363

tsconfig.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"~/*": ["src/*"]
99
}
1010
},
11+
"include": [".astro/types.d.ts", "**/*"],
1112
"exclude": ["dist/"]
1213
}

0 commit comments

Comments
 (0)