aboutsummaryrefslogtreecommitdiff
path: root/src/utils/schemas/blogSchema.ts
blob: 7ff84d84a68a347a88319b5754abdc25960bfbb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import type { WithContext, Blog } from "schema-dts";

export type BlogSchemaParams = {
	readonly siteUrl: string;
	readonly title: string;
};

export default ({ siteUrl, title }: BlogSchemaParams): WithContext<Blog> => ({
	"@context": "https://schema.org",
	"@type": "Blog",
	"url": new URL("/blog/", siteUrl).toString(),
	"name": title,
});