@@ -13,7 +13,6 @@
|
||||
import RecipeNote from '$lib/components/RecipeNote.svelte';
|
||||
import {stripHtmlTags} from '$lib/js/stripHtmlTags';
|
||||
import FavoriteButton from '$lib/components/FavoriteButton.svelte';
|
||||
import { generateRecipeJsonLd } from '$lib/js/recipeJsonLd';
|
||||
|
||||
export let data: PageData;
|
||||
|
||||
@@ -278,7 +277,7 @@ h4{
|
||||
<meta property="og:image:secure_url" content="https://bocken.org/static/rezepte/thumb/{data.short_name}.webp" />
|
||||
<meta property="og:image:type" content="image/webp" />
|
||||
<meta property="og:image:alt" content="{stripHtmlTags(data.name)}" />
|
||||
<script type="application/ld+json">{JSON.stringify(generateRecipeJsonLd(data))}</script>
|
||||
<script type="application/ld+json">{JSON.stringify(data.recipeJsonLd)}</script>
|
||||
</svelte:head>
|
||||
|
||||
<TitleImgParallax src={hero_img_src} {placeholder_src}>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { error } from "@sveltejs/kit";
|
||||
import { generateRecipeJsonLd } from '$lib/js/recipeJsonLd';
|
||||
|
||||
export async function load({ fetch, params, url}) {
|
||||
const res = await fetch(`/api/rezepte/items/${params.name}`);
|
||||
@@ -101,9 +102,13 @@ export async function load({ fetch, params, url}) {
|
||||
}
|
||||
}
|
||||
|
||||
// Generate JSON-LD server-side
|
||||
const recipeJsonLd = generateRecipeJsonLd(item);
|
||||
|
||||
return {
|
||||
...item,
|
||||
isFavorite,
|
||||
multiplier
|
||||
multiplier,
|
||||
recipeJsonLd
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user