mirror of
https://github.com/valentineus/popov.link.git
synced 2025-07-04 00:20:26 +03:00
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.
This commit is contained in:
@ -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",
|
||||
|
Reference in New Issue
Block a user