Add JSON-LD structured data for recipes
Some checks failed
CI / update (push) Failing after 59s

- Create recipeJsonLd.ts function with Schema.org compliant Recipe markup
- Add API endpoint at /api/rezepte/json-ld/[name] for on-demand generation
- Include proper ISO 8601 time parsing for German formats
- Add rel="alternate" link in recipe pages for discoverability
- Set author to Alexander Bocken with proper Person type
- Include caching headers for performance optimization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-04 18:57:36 +02:00
parent 6a8478f8a6
commit e01ff9eb59
3 changed files with 160 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
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;
@@ -277,6 +278,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)}" />
<link rel="alternate" type="application/ld+json" href="/api/rezepte/json-ld/{data.short_name}" />
</svelte:head>
<TitleImgParallax src={hero_img_src} {placeholder_src}>