aboutsummaryrefslogtreecommitdiff
path: root/src/utils/schemas
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/schemas')
-rw-r--r--src/utils/schemas/blogPostSchema.ts15
-rw-r--r--src/utils/schemas/blogSchema.ts2
-rw-r--r--src/utils/schemas/websiteSchema.ts4
3 files changed, 12 insertions, 9 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",
diff --git a/src/utils/schemas/blogSchema.ts b/src/utils/schemas/blogSchema.ts
index 54e2fca..66a9bae 100644
--- a/src/utils/schemas/blogSchema.ts
+++ b/src/utils/schemas/blogSchema.ts
@@ -2,9 +2,9 @@ import type { WithContext, CollectionPage } from "schema-dts";
import type { CollectionEntry } from "astro:content";
export type BlogSchemaParams = {
+ readonly posts: CollectionEntry<"blog">[];
readonly siteUrl: string;
readonly title: string;
- readonly posts: CollectionEntry<"blog">[];
};
export default ({ siteUrl, title, posts }: BlogSchemaParams): WithContext<CollectionPage> => ({
diff --git a/src/utils/schemas/websiteSchema.ts b/src/utils/schemas/websiteSchema.ts
index bebb963..b971e5e 100644
--- a/src/utils/schemas/websiteSchema.ts
+++ b/src/utils/schemas/websiteSchema.ts
@@ -1,13 +1,15 @@
import type { WithContext, WebSite } from "schema-dts";
export type WebsiteSchemaParams = {
+ readonly description: string;
readonly siteUrl: string;
readonly title: string;
};
-export default ({ siteUrl, title }: WebsiteSchemaParams): WithContext<WebSite> => ({
+export default ({ siteUrl, title, description }: WebsiteSchemaParams): WithContext<WebSite> => ({
"@context": "https://schema.org",
"@type": "WebSite",
"url": new URL("/", siteUrl).toString(),
"name": title,
+ "description": description,
});