diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro index 28c178c..038db43 100644 --- a/src/components/BaseHead.astro +++ b/src/components/BaseHead.astro @@ -19,7 +19,7 @@ export interface Props { const canonicalURL = new URL(Astro.url.pathname, Astro.site); -const { title, description, path, og } = Astro.props; +const { title, description, og } = Astro.props; const image = og.image ?? new URL('/images/og-image.jpg', Astro.url); --- diff --git a/src/content/blog/first-post.md b/src/content/blog/first-post.md index 3066715..63f0e1b 100644 --- a/src/content/blog/first-post.md +++ b/src/content/blog/first-post.md @@ -1,8 +1,8 @@ --- title: 'First post' description: 'Lorem ipsum dolor sit amet' -pubDate: 'Jul 08 2022' -heroImage: '/blog-placeholder-3.jpg' +date: 'Jul 08 2022' +image: '/blog-placeholder-3.jpg' --- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet. diff --git a/src/content/blog/markdown-style-guide.md b/src/content/blog/markdown-style-guide.md index cf02c41..31419f1 100644 --- a/src/content/blog/markdown-style-guide.md +++ b/src/content/blog/markdown-style-guide.md @@ -1,8 +1,8 @@ --- title: 'Markdown Style Guide' description: 'Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro.' -pubDate: 'Jul 01 2022' -heroImage: '/blog-placeholder-1.jpg' +date: 'Jul 01 2022' +image: '/blog-placeholder-1.jpg' --- Here is a sample of some basic Markdown syntax that can be used when writing Markdown content in Astro. diff --git a/src/content/blog/second-post.md b/src/content/blog/second-post.md index f47e093..536176a 100644 --- a/src/content/blog/second-post.md +++ b/src/content/blog/second-post.md @@ -1,8 +1,8 @@ --- title: 'Second post' description: 'Lorem ipsum dolor sit amet' -pubDate: 'Jul 15 2022' -heroImage: '/blog-placeholder-4.jpg' +date: 'Jul 15 2022' +image: '/blog-placeholder-4.jpg' --- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet. diff --git a/src/content/blog/third-post.md b/src/content/blog/third-post.md index af82f0e..03554b7 100644 --- a/src/content/blog/third-post.md +++ b/src/content/blog/third-post.md @@ -1,8 +1,8 @@ --- title: 'Third post' description: 'Lorem ipsum dolor sit amet' -pubDate: 'Jul 22 2022' -heroImage: '/blog-placeholder-2.jpg' +date: 'Jul 22 2022' +image: '/blog-placeholder-2.jpg' --- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Vitae ultricies leo integer malesuada nunc vel risus commodo viverra. Adipiscing enim eu turpis egestas pretium. Euismod elementum nisi quis eleifend quam adipiscing. In hac habitasse platea dictumst vestibulum. Sagittis purus sit amet volutpat. Netus et malesuada fames ac turpis egestas. Eget magna fermentum iaculis eu non diam phasellus vestibulum lorem. Varius sit amet mattis vulputate enim. Habitasse platea dictumst quisque sagittis. Integer quis auctor elit sed vulputate mi. Dictumst quisque sagittis purus sit amet. diff --git a/src/content/blog/using-mdx.mdx b/src/content/blog/using-mdx.mdx index d976693..43d6803 100644 --- a/src/content/blog/using-mdx.mdx +++ b/src/content/blog/using-mdx.mdx @@ -1,8 +1,8 @@ --- title: 'Using MDX' description: 'Lorem ipsum dolor sit amet' -pubDate: 'Jul 02 2022' -heroImage: '/blog-placeholder-5.jpg' +date: 'Jul 02 2022' +image: '/blog-placeholder-5.jpg' --- This theme comes with the [@astrojs/mdx](https://docs.astro.build/en/guides/integrations-guide/mdx/) integration installed and configured in your `astro.config.mjs` config file. If you prefer not to use MDX, you can disable support by removing the integration from your config file. diff --git a/src/content/config.ts b/src/content/config.ts index 667a31c..7eb08a9 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -1,15 +1,15 @@ -import { defineCollection, z } from 'astro:content'; +import { defineCollection, z } from "astro:content"; const blog = defineCollection({ - type: 'content', + type: "content", // Type-check frontmatter using a schema schema: z.object({ title: z.string(), description: z.string(), - // Transform string to Date object - pubDate: z.coerce.date(), - updatedDate: z.coerce.date().optional(), - heroImage: z.string().optional(), + date: z.coerce.date(), + lastmod: z.coerce.date().optional(), + tags: z.array(z.string()).optional(), + image: z.string().optional(), }), }); diff --git a/src/layouts/BlogPost.astro b/src/layouts/BlogPost.astro index b33c92b..4ce058b 100644 --- a/src/layouts/BlogPost.astro +++ b/src/layouts/BlogPost.astro @@ -7,7 +7,7 @@ import FormattedDate from '../components/FormattedDate.astro'; type Props = CollectionEntry<'blog'>['data']; -const { title, description, pubDate, updatedDate, heroImage } = Astro.props; +const { title, description, date, lastmod, image } = Astro.props; --- @@ -59,16 +59,16 @@ const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
- {heroImage && } + {image && }
- + { - updatedDate && ( + lastmod && (
- Last updated on + Last updated on
) } diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 6e12b26..7d6e337 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -16,7 +16,7 @@ export interface Props { } }; -const site = Astro.site ?? ""; +// const site = Astro.site ?? ""; --- diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index ebbcd30..a3f02b6 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -7,14 +7,14 @@ import { getCollection } from 'astro:content'; import FormattedDate from '../../components/FormattedDate.astro'; const posts = (await getCollection('blog')).sort( - (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf() + (a, b) => a.data.date.valueOf() - b.data.date.valueOf() ); --- - +