Skip to content

Commit 77a75c2

Browse files
authored
Merge pull request #565 from onwidget/migration-astro-v5
Migration astro v5
2 parents f79639c + 082ab11 commit 77a75c2

19 files changed

+1598
-1440
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
🌟 _Most *starred* & *forked* Astro theme in 2022 & 2023_. 🌟
77

8-
**AstroWind** is a free and open-source template to make your website using **[Astro 4.0](https://astro.build/) + [Tailwind CSS](https://tailwindcss.com/)**. Ready to start a new project and designed taking into account web best practices.
8+
**AstroWind** is a free and open-source template to make your website using **[Astro 5.0](https://astro.build/) + [Tailwind CSS](https://tailwindcss.com/)**. Ready to start a new project and designed taking into account web best practices.
99

1010
-**Production-ready** scores in **PageSpeed Insights** reports.
1111
- ✅ Integration with **Tailwind CSS** supporting **Dark mode** and **_RTL_**.
@@ -65,7 +65,7 @@ We're embarking on an exciting journey with **AstroWind 2.0**, and we want you t
6565

6666
## Getting started
6767

68-
**AstroWind** tries to give you quick access to creating a website using [Astro 4.0](https://astro.build/) + [Tailwind CSS](https://tailwindcss.com/). It's a free theme which focuses on simplicity, good practices and high performance.
68+
**AstroWind** tries to give you quick access to creating a website using [Astro 5.0](https://astro.build/) + [Tailwind CSS](https://tailwindcss.com/). It's a free theme which focuses on simplicity, good practices and high performance.
6969

7070
Very little vanilla javascript is used only to provide basic functionality so that each developer decides which framework (React, Vue, Svelte, Solid JS...) to use and how to approach their goals.
7171

package-lock.json

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

package.json

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@onwidget/astrowind",
3-
"version": "1.0.0-beta.48",
4-
"description": "AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.",
3+
"version": "1.0.0-beta.49",
4+
"description": "AstroWind: A free template using Astro 5.0 and Tailwind CSS. Astro starter theme.",
55
"type": "module",
66
"private": true,
77
"engines": {
@@ -22,48 +22,48 @@
2222
"fix:prettier": "prettier -w ."
2323
},
2424
"dependencies": {
25-
"@astrojs/rss": "^4.0.8",
26-
"@astrojs/sitemap": "^3.2.0",
25+
"@astrojs/rss": "^4.0.10",
26+
"@astrojs/sitemap": "^3.2.1",
2727
"@astrolib/analytics": "^0.6.1",
2828
"@astrolib/seo": "^1.0.0-beta.8",
2929
"@fontsource-variable/inter": "^5.1.0",
30-
"astro": "^4.16.2",
31-
"astro-embed": "^0.7.4",
32-
"astro-icon": "^1.1.1",
30+
"astro": "^5.0.3",
31+
"astro-embed": "^0.9.0",
32+
"astro-icon": "^1.1.4",
3333
"limax": "4.1.0",
3434
"lodash.merge": "^4.6.2",
35-
"unpic": "^3.18.0"
35+
"unpic": "^3.22.0"
3636
},
3737
"devDependencies": {
3838
"@astrojs/check": "^0.9.4",
39-
"@astrojs/mdx": "^3.1.8",
39+
"@astrojs/mdx": "^4.0.1",
4040
"@astrojs/partytown": "^2.1.2",
41-
"@astrojs/tailwind": "5.1.2",
42-
"@eslint/js": "^9.12.0",
41+
"@astrojs/tailwind": "^5.1.3",
42+
"@eslint/js": "^9.16.0",
4343
"@iconify-json/flat-color-icons": "^1.2.0",
44-
"@iconify-json/tabler": "^1.2.5",
44+
"@iconify-json/tabler": "^1.2.10",
4545
"@tailwindcss/typography": "^0.5.15",
4646
"@types/eslint__js": "^8.42.3",
4747
"@types/js-yaml": "^4.0.9",
4848
"@types/lodash.merge": "^4.6.9",
4949
"@types/mdx": "^2.0.13",
50-
"@typescript-eslint/eslint-plugin": "^8.8.1",
51-
"@typescript-eslint/parser": "^8.8.1",
52-
"astro-compress": "2.3.3",
53-
"astro-eslint-parser": "^1.0.3",
54-
"eslint": "^9.12.0",
55-
"eslint-plugin-astro": "^1.2.4",
56-
"globals": "^15.11.0",
50+
"@typescript-eslint/eslint-plugin": "^8.17.0",
51+
"@typescript-eslint/parser": "^8.17.0",
52+
"astro-compress": "2.3.5",
53+
"astro-eslint-parser": "^1.1.0",
54+
"eslint": "^9.16.0",
55+
"eslint-plugin-astro": "^1.3.1",
56+
"globals": "^15.13.0",
5757
"js-yaml": "^4.1.0",
5858
"mdast-util-to-string": "^4.0.0",
59-
"prettier": "^3.3.3",
59+
"prettier": "^3.4.2",
6060
"prettier-plugin-astro": "^0.14.1",
6161
"reading-time": "^1.5.0",
6262
"sharp": "0.33.5",
63-
"tailwind-merge": "^2.5.3",
64-
"tailwindcss": "^3.4.13",
65-
"typescript": "^5.6.3",
66-
"typescript-eslint": "^8.8.1",
63+
"tailwind-merge": "^2.5.5",
64+
"tailwindcss": "^3.4.16",
65+
"typescript": "^5.7.2",
66+
"typescript-eslint": "^8.17.0",
6767
"unist-util-visit": "^5.0.0"
6868
}
6969
}

src/components/blog/Tags.astro

+5-7
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ const { tags, class: className = 'text-sm', title = undefined, isCategory = fals
1717
{
1818
tags && Array.isArray(tags) && (
1919
<>
20-
<>
21-
{title !== undefined && (
22-
<span class="align-super font-normal underline underline-offset-4 decoration-2 dark:text-slate-400">
23-
{title}
24-
</span>
25-
)}
26-
</>
20+
{title !== undefined && (
21+
<span class="align-super font-normal underline underline-offset-4 decoration-2 dark:text-slate-400">
22+
{title}
23+
</span>
24+
)}
2725
<ul class={className}>
2826
{tags.map((tag) => (
2927
<li class="bg-gray-100 dark:bg-slate-700 inline-block mr-2 rtl:mr-0 rtl:ml-2 mb-2 py-0.5 px-2 lowercase font-medium">

src/components/widgets/Announcement.astro

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
class="dark:bg-slate-700 bg-white/40 dark:text-slate-300 font-semibold px-1 py-0.5 text-xs mr-0.5 rtl:mr-0 rtl:ml-0.5 inline-block"
1010
>NEW</span
1111
>
12-
<a href="https://astro.build/blog/astro-4150/" class="text-muted hover:underline dark:text-slate-400 font-medium"
13-
>Astro 4.15 is now available! »</a
12+
<a href="https://astro.build/blog/astro-5/" class="text-muted hover:underline dark:text-slate-400 font-medium"
13+
>Astro v5.0.0 is now available! »</a
1414
>
1515
<a
1616
target="_blank"

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/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/saas.astro

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const metadata = {
6060
<span class="hidden sm:inline">
6161
Elevate your website creation process with <span class="font-semibold">AstroWind</span>'s SaaS solutions.</span
6262
>
63-
Seamlessly blend the power of Astro 4.0 and Tailwind CSS to craft websites that resonate with your brand and audience.
63+
Seamlessly blend the power of Astro 5.0 and Tailwind CSS to craft websites that resonate with your brand and audience.
6464
</Fragment>
6565
</Hero2>
6666

@@ -73,7 +73,7 @@ const metadata = {
7373
columns={2}
7474
items={[
7575
{
76-
title: 'Integration of Astro 4.0 and Tailwind CSS',
76+
title: 'Integration of Astro 5.0 and Tailwind CSS',
7777
description:
7878
'Offers a powerful combination that enhances both the development process and the end-user experience. Also, allows to build dynamic and visually stunning websites with optimized performance.',
7979
icon: 'tabler:layers-union',
@@ -96,7 +96,7 @@ const metadata = {
9696
},
9797
{
9898
title: 'Fast loading times and production-ready code',
99-
description: `Using Astro 4.0 ensures fast loading and seamless rendering, enhancing browsing. The code follows best practices, improving user experience, SEO, and reducing bounce rates.`,
99+
description: `Using Astro 5.0 ensures fast loading and seamless rendering, enhancing browsing. The code follows best practices, improving user experience, SEO, and reducing bounce rates.`,
100100
icon: 'tabler:rocket',
101101
},
102102
{
@@ -117,7 +117,7 @@ const metadata = {
117117
{
118118
title: 'Description:',
119119
description:
120-
'Are you a startup with big dreams? AstroWind propels your success. Our template forges a seamless online presence, attracting investors and customers from day one. Astro 4.0 and Tailwind CSS ensure striking, responsive sites, leaving lasting impressions. Countless startups leverage AstroWind to kickstart their journey and resonate with audiences.',
120+
'Are you a startup with big dreams? AstroWind propels your success. Our template forges a seamless online presence, attracting investors and customers from day one. Astro 5.0 and Tailwind CSS ensure striking, responsive sites, leaving lasting impressions. Countless startups leverage AstroWind to kickstart their journey and resonate with audiences.',
121121
},
122122
{
123123
title: 'Benefits:',
@@ -147,7 +147,7 @@ const metadata = {
147147
items={[
148148
{
149149
title: 'Description:',
150-
description: `For SaaS businesses, user experience is key. AstroWind enhances showcasing SaaS solutions intuitively. The template's Astro 4.0 and Tailwind CSS integration guarantees user-friendly experience, mirroring your software's efficiency. Customize pages to communicate SaaS value and solutions for your audience.`,
150+
description: `For SaaS businesses, user experience is key. AstroWind enhances showcasing SaaS solutions intuitively. The template's Astro 5.0 and Tailwind CSS integration guarantees user-friendly experience, mirroring your software's efficiency. Customize pages to communicate SaaS value and solutions for your audience.`,
151151
},
152152
{
153153
title: 'Benefits:',

src/pages/homes/startup.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const metadata = {
6060

6161
<Features2
6262
title="About us"
63-
subtitle="We believe in the magic of turning dreams into stunning realities. Founded by passionate developers with a shared vision, we set out to simplify the website creation process. Our templates bring together the innovation of Astro 4.0 and the versatility of Tailwind CSS, enabling you to express your unique brand identity like never before."
63+
subtitle="We believe in the magic of turning dreams into stunning realities. Founded by passionate developers with a shared vision, we set out to simplify the website creation process. Our templates bring together the innovation of Astro 5.0 and the versatility of Tailwind CSS, enabling you to express your unique brand identity like never before."
6464
>
6565
<Fragment slot="bg">
6666
<div class="absolute inset-0 bg-blue-50 dark:bg-transparent"></div>

src/pages/index.astro

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ const metadata = {
3636
>
3737
<Fragment slot="title">
3838
Free template for <span class="hidden xl:inline">creating websites with</span>
39-
<span class="text-accent dark:text-white highlight"> Astro 4.0</span> + Tailwind CSS
39+
<span class="text-accent dark:text-white highlight"> Astro 5.0</span> + Tailwind CSS
4040
</Fragment>
4141

4242
<Fragment slot="subtitle">
4343
<span class="hidden sm:inline">
44-
<span class="font-semibold">AstroWind</span> is a free, customizable and production-ready template for Astro 4.0
44+
<span class="font-semibold">AstroWind</span> is a free, customizable and production-ready template for Astro 5.0
4545
+ Tailwind CSS.</span
4646
>
4747
<span class="block mb-1 sm:hidden font-bold text-blue-600">AstroWind: Production-ready.</span>
@@ -60,7 +60,7 @@ const metadata = {
6060
id="features"
6161
tagline="Features"
6262
title="What you get with AstroWind"
63-
subtitle="One of the most professional and comprehensive templates currently on the market. Most starred & forked Astro theme in 2022."
63+
subtitle="One of the most professional and comprehensive templates currently on the market. Most starred & forked Astro theme in 2022, 2023 and 2024."
6464
items={[
6565
{
6666
title: 'Astro + Tailwind CSS Integration',
@@ -109,7 +109,7 @@ const metadata = {
109109
title="AstroWind's Blueprint: Fun Meets Functionality!"
110110
items={[
111111
{
112-
title: 'Built on top of Astro 4.0',
112+
title: 'Built on top of Astro 5.0',
113113
description:
114114
'Benefiting from the performance and developer-friendly features of this modern static site generator.',
115115
},

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

src/utils/frontmatter.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import getReadingTime from 'reading-time';
22
import { toString } from 'mdast-util-to-string';
33
import { visit } from 'unist-util-visit';
4-
import type { MarkdownAstroData, RehypePlugin, RemarkPlugin } from '@astrojs/markdown-remark';
4+
import type { RehypePlugin, RemarkPlugin } from '@astrojs/markdown-remark';
55

66
export const readingTimeRemarkPlugin: RemarkPlugin = () => {
77
return function (tree, file) {
88
const textOnPage = toString(tree);
99
const readingTime = Math.ceil(getReadingTime(textOnPage).minutes);
1010

11-
(file.data.astro as MarkdownAstroData).frontmatter.readingTime = readingTime;
11+
if (typeof file?.data?.astro?.frontmatter !== 'undefined') {
12+
file.data.astro.frontmatter.readingTime = readingTime;
13+
}
1214
};
1315
};
1416

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)