diff options
author | Valentin Popov <valentin@popov.link> | 2025-06-14 14:25:17 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2025-06-14 14:25:17 +0300 |
commit | 17f9a467d7c0f427ae9d1cd579988a26615311c7 (patch) | |
tree | dfa72e6ca88f8ff1806477853d292dcef2b1255c /src/utils/schemas/blogPostSchema.ts | |
parent | 3df02c5304b8faee540694b15041ad2ee43bc1b2 (diff) | |
download | popov.link-17f9a467d7c0f427ae9d1cd579988a26615311c7.tar.xz popov.link-17f9a467d7c0f427ae9d1cd579988a26615311c7.zip |
refactor: update blog post date handling and schema
- Replaced `pubDate` with `datePublished` in blog post components for consistency.
- Updated sorting logic in blog sections to use `datePublished`.
- Enhanced blog post schema to include `dateModified` for better structured data representation.
- Adjusted various blog markdown files to reflect the new date fields.
Diffstat (limited to 'src/utils/schemas/blogPostSchema.ts')
-rw-r--r-- | src/utils/schemas/blogPostSchema.ts | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/utils/schemas/blogPostSchema.ts b/src/utils/schemas/blogPostSchema.ts index 5393cb1..00395dd 100644 --- a/src/utils/schemas/blogPostSchema.ts +++ b/src/utils/schemas/blogPostSchema.ts @@ -1,23 +1,24 @@ import type { WithContext, BlogPosting } from "schema-dts"; export type BlogPostSchemaParams = { - readonly siteUrl: string; - readonly title: string; - readonly description: string; - readonly slug: string; - readonly datePublished: string; readonly author: string; + readonly dateModified: string; + readonly datePublished: string; + readonly description: string; readonly lang: string; + readonly siteUrl: string; + readonly slug: string; + readonly title: string; }; -export default ({ siteUrl, title, description, slug, datePublished, author, lang }: BlogPostSchemaParams): WithContext<BlogPosting> => ({ +export default ({ siteUrl, slug, title, description, datePublished, dateModified, author, lang }: BlogPostSchemaParams): WithContext<BlogPosting> => ({ "@context": "https://schema.org", "@type": "BlogPosting", "url": new URL(`/blog/${slug}`, siteUrl).toString(), "headline": title, "description": description, "datePublished": datePublished, - "dateModified": datePublished, + "dateModified": dateModified, "inLanguage": lang, "author": { "@type": "Person", |