From 27c7ffacf630555788c81f83645e62c069315710 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sun, 15 Dec 2024 00:50:58 +0100 Subject: [PATCH] add seo --- pages/categories/[name].vue | 26 +++++++++++++++++++++++--- pages/categories/index.vue | 13 +++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/pages/categories/[name].vue b/pages/categories/[name].vue index cec2fbb..cca8c0c 100644 --- a/pages/categories/[name].vue +++ b/pages/categories/[name].vue @@ -10,20 +10,40 @@ if (!recipes.value) { statusMessage: "Category not found", }); } + +const { data: categories } = await useCategories(); +const category = categories.value?.find((c) => c.name === categoryName); + +const url = useRequestURL(); +useSeoMeta({ + title: `${categoryName} | Mood2Food`, + description: "The perfect meal that fits your mood", + ogTitle: `${categoryName} | Mood2Food`, + ogDescription: "The perfect meal that fits your mood", + ogImage: category!.picture, + ogUrl: url.href, + twitterTitle: `${categoryName} | Mood2Food`, + twitterDescription: "The perfect meal that fits your mood", + twitterImage: category!.picture, + twitterCard: "summary", +});