Skip to content

Commit e041b0a

Browse files
authored
chore: update astro to latest version (#354)
1 parent 010fea4 commit e041b0a

File tree

6 files changed

+2508
-2985
lines changed

6 files changed

+2508
-2985
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# build output
22
dist/
3+
.astro
34

45
# dependencies
56
node_modules/

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
"editor.defaultFormatter": "esbenp.prettier-vscode"
2121
},
2222
"[astro]": {
23-
"editor.defaultFormatter": "esbenp.prettier-vscode"
23+
"editor.defaultFormatter": "astro-build.astro-vscode"
2424
}
2525
}

astro.config.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { remarkReadingTime } from "./plugins/remark-reading-time.mjs";
99

1010
/** @type {import('rehype-pretty-code').Options} */
1111
const options = {
12-
theme: {
13-
dark: "github-dark",
14-
light: "min-light",
15-
},
12+
// theme: {
13+
// dark: "github-dark",
14+
// light: "min-light",
15+
// },
1616
keepBackground: false,
1717
onVisitLine(node) {
1818
// Prevent lines from collapsing in `display: grid` mode, and

package.json

+11-8
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,25 @@
1111
"ui": "yarn upgrade-interactive"
1212
},
1313
"devDependencies": {
14-
"@astrojs/mdx": "^1.1.0",
15-
"@astrojs/prefetch": "^0.4.0",
16-
"@astrojs/rss": "^3.0.0",
17-
"@astrojs/sitemap": "^3.0.0",
18-
"@astrojs/tailwind": "^5.0.0",
14+
"@astrojs/mdx": "4.2.4",
15+
"@astrojs/prefetch": "0.4.1",
16+
"@astrojs/rss": "4.0.11",
17+
"@astrojs/sitemap": "3.3.0",
18+
"@astrojs/tailwind": "6.0.2",
1919
"@tailwindcss/typography": "^0.5.10",
20-
"astro": "^3.1.2",
20+
"astro": "5.6.2",
2121
"astro-icon": "^0.8.1",
2222
"cypress": "^14.3.0",
2323
"mdast-util-to-string": "^4.0.0",
2424
"prettier": "^3.5.3",
2525
"reading-time": "^1.5.0",
26-
"rehype-pretty-code": "^0.10.1",
26+
"rehype-pretty-code": "^0.14.1",
2727
"sharp": "^0.34.1",
2828
"tailwindcss": "^3.4.17",
2929
"typescript": "^5.8.3"
3030
},
31-
"packageManager": "yarn@3.6.3"
31+
"packageManager": "yarn@3.6.3",
32+
"dependencies": {
33+
"shiki": "^3.2.2"
34+
}
3235
}

src/layouts/BlogPost.astro

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface Props {
1111
}
1212
1313
const {
14-
content: { title, description, pubDate, heroImage, heroImageMetadata, url, readingTime, file, tags },
14+
content: { title, description, pubDate, heroImage, url, readingTime, file, tags },
1515
} = Astro.props as Props;
1616
1717
const tweetLink = `https://twitter.com/intent/tweet?url=
@@ -31,6 +31,14 @@ const currentPostIndex = posts.findIndex(
3131
posts.splice(currentPostIndex, 1);
3232
3333
const otherPosts = posts.slice(-3);
34+
35+
const images = import.meta.glob("../assets/blog/**/*", {
36+
eager: true,
37+
});
38+
39+
const image = images[heroImage] as { default: ImageMetadata };
40+
41+
const heroImageMetadata = image.default as ImageMetadata;
3442
---
3543

3644
<PageLayout meta={{ title, description, image: heroImage }}>

0 commit comments

Comments
 (0)