Feat: JsonLd product metadata (#2)

* Generates JSON ld structured metadata from a product & appends to head

* Updated IProduct & IVariation interface

* Added IProductResponse & IProductsResponse interfaces

* Fixed sitemap urls having to many protocols
This commit is contained in:
2022-11-28 22:19:32 +01:00
committed by GitHub
parent f3751da335
commit 296cfb80a0
17 changed files with 103 additions and 45 deletions

View File

@@ -1,5 +1,6 @@
import { dev } from '$app/environment';
import { env } from '$env/dynamic/private';
import type { IProductResponse } from '$lib/interfaces/ApiResponse';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ fetch, params }) => {
@@ -11,6 +12,6 @@ export const load: PageServerLoad = async ({ fetch, params }) => {
}
const res = await fetch(url);
const product = await res.json();
const product: IProductResponse = await res.json();
return product;
};