Merge pull request 'fix(deps): update dependency astro to v6' (!21) from renovate/major-astro-monorepo into master
Reviewed-on: #21
This commit was merged in pull request #21.
This commit is contained in:
1425
package-lock.json
generated
1425
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,7 @@
|
|||||||
"@astrojs/rss": "^4.0.12",
|
"@astrojs/rss": "^4.0.12",
|
||||||
"@astrojs/sitemap": "^3.4.1",
|
"@astrojs/sitemap": "^3.4.1",
|
||||||
"@resvg/resvg-js": "^2.6.2",
|
"@resvg/resvg-js": "^2.6.2",
|
||||||
"astro": "^5.9.0",
|
"astro": "^6.0.0",
|
||||||
"autoprefixer": "^10.4.21",
|
"autoprefixer": "^10.4.21",
|
||||||
"cssnano": "^7.0.7",
|
"cssnano": "^7.0.7",
|
||||||
"cssnano-preset-advanced": "^7.0.7",
|
"cssnano-preset-advanced": "^7.0.7",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import { type CollectionEntry } from "astro:content";
|
import { type CollectionEntry, render } from "astro:content";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@@ -7,7 +7,7 @@ type Props = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const { post } = Astro.props;
|
const { post } = Astro.props;
|
||||||
const { remarkPluginFrontmatter } = await post.render();
|
const { remarkPluginFrontmatter } = await render(post);
|
||||||
|
|
||||||
const formattedDate = dayjs(post.data.datePublished.toString()).format("MMMM DD, YYYY");
|
const formattedDate = dayjs(post.data.datePublished.toString()).format("MMMM DD, YYYY");
|
||||||
const datePublished = post.data.datePublished.toISOString();
|
const datePublished = post.data.datePublished.toISOString();
|
||||||
@@ -28,7 +28,7 @@ const datePublished = post.data.datePublished.toISOString();
|
|||||||
|
|
||||||
<li>
|
<li>
|
||||||
<article>
|
<article>
|
||||||
<a href={`/blog/${post.slug}`} lang={post.data.lang}>{post.data.title}</a>
|
<a href={`/blog/${post.id}`} lang={post.data.lang}>{post.data.title}</a>
|
||||||
<div>
|
<div>
|
||||||
<small>
|
<small>
|
||||||
<time datetime={datePublished} lang="en">{formattedDate}</time>
|
<time datetime={datePublished} lang="en">{formattedDate}</time>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ const latestPosts = posts.slice(0, 5);
|
|||||||
{
|
{
|
||||||
latestPosts.map((post) => (
|
latestPosts.map((post) => (
|
||||||
<li>
|
<li>
|
||||||
<a href={`/blog/${post.slug}`} lang={post.data.lang}>
|
<a href={`/blog/${post.id}`} lang={post.data.lang}>
|
||||||
{post.data.title}
|
{post.data.title}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import { defineCollection, z } from "astro:content";
|
import { defineCollection } from "astro:content";
|
||||||
|
import { glob } from "astro/loaders";
|
||||||
|
import { z } from "astro/zod";
|
||||||
|
|
||||||
const blog = defineCollection({
|
const blog = defineCollection({
|
||||||
type: "content",
|
loader: glob({ pattern: "**/*.md", base: "./src/content/blog" }),
|
||||||
schema: z.object({
|
schema: z.object({
|
||||||
basedOn: z.optional(z.string()),
|
basedOn: z.optional(z.string()),
|
||||||
dateModified: z.coerce.date(),
|
dateModified: z.coerce.date(),
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
import { type CollectionEntry, getCollection } from "astro:content";
|
import { type CollectionEntry, getCollection, render } from "astro:content";
|
||||||
import Comments from "../../components/Comments.astro";
|
import Comments from "../../components/Comments.astro";
|
||||||
import Layout from "../../layouts/BaseLayout.astro";
|
import Layout from "../../layouts/BaseLayout.astro";
|
||||||
import blogPostSchema from "../../utils/schemas/blogPostSchema";
|
import blogPostSchema from "../../utils/schemas/blogPostSchema";
|
||||||
@@ -13,20 +13,20 @@ export async function getStaticPaths() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return posts.map((post) => ({
|
return posts.map((post) => ({
|
||||||
params: { slug: post.slug },
|
params: { slug: post.id },
|
||||||
props: post,
|
props: post,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
const post = Astro.props;
|
const post = Astro.props;
|
||||||
|
|
||||||
const { Content, remarkPluginFrontmatter } = await post.render();
|
const { Content, remarkPluginFrontmatter } = await render(post);
|
||||||
|
|
||||||
const description = post.data.description;
|
const description = post.data.description;
|
||||||
const isBasedOn = post.data.basedOn;
|
const isBasedOn = post.data.basedOn;
|
||||||
const lang = post.data.lang;
|
const lang = post.data.lang;
|
||||||
const preview = `/images/preview/${post.slug}.png`;
|
const preview = `/images/preview/${post.id}.png`;
|
||||||
const slug = post.slug;
|
const slug = post.id;
|
||||||
const title = post.data.title;
|
const title = post.data.title;
|
||||||
|
|
||||||
const dateModified = post.data.dateModified?.toISOString();
|
const dateModified = post.data.dateModified?.toISOString();
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ export async function GET(context) {
|
|||||||
customData: `<language>en</language>`,
|
customData: `<language>en</language>`,
|
||||||
description: description,
|
description: description,
|
||||||
items: posts.map((post) => ({
|
items: posts.map((post) => ({
|
||||||
customData: post.data.customData,
|
|
||||||
description: post.data.description,
|
description: post.data.description,
|
||||||
link: `/blog/${post.slug}`,
|
link: `/blog/${post.id}`,
|
||||||
pubDate: post.data.pubDate,
|
pubDate: post.data.datePublished,
|
||||||
title: post.data.title,
|
title: post.data.title,
|
||||||
})),
|
})),
|
||||||
site: context.site,
|
site: context.site,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export default ({ siteUrl, title, posts }: BlogSchemaParams): WithContext<Collec
|
|||||||
"itemListElement": posts.map((post, index) => ({
|
"itemListElement": posts.map((post, index) => ({
|
||||||
"@type": "ListItem",
|
"@type": "ListItem",
|
||||||
"position": index + 1,
|
"position": index + 1,
|
||||||
"url": new URL(`/blog/${post.slug}`, siteUrl).toString(),
|
"url": new URL(`/blog/${post.id}`, siteUrl).toString(),
|
||||||
"name": post.data.title,
|
"name": post.data.title,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user