From 8c407ca069055ad4b635e6cf9cf3c2f0df758cbb Mon Sep 17 00:00:00 2001 From: Mathias Schopmans Date: Tue, 26 Mar 2024 09:50:55 +0100 Subject: [PATCH] feat: add configurable meta description for homepage --- data/config.default.json | 3 ++- src/pages/index.tsx | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/data/config.default.json b/data/config.default.json index 0e3730c3..0708a9b4 100644 --- a/data/config.default.json +++ b/data/config.default.json @@ -133,6 +133,7 @@ "pageAbout": "How to use AOE Technology Radar?", "pageOverview": "Technologies Overview", "pageSearch": "Search", - "searchPlaceholder": "What are you looking for?" + "searchPlaceholder": "What are you looking for?", + "metaDescription": "" } } diff --git a/src/pages/index.tsx b/src/pages/index.tsx index c96bb413..af89970a 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,3 +1,4 @@ +import Head from "next/head"; import { useRouter } from "next/router"; import { QuadrantList } from "@/components/QuadrantList/QuadrantList"; @@ -7,6 +8,7 @@ import { getAppName, getChartConfig, getItems, + getLabel, getQuadrants, getReleases, getRings, @@ -20,6 +22,7 @@ const Home: CustomPage = () => { const router = useRouter(); const tag = router.query.tag as string | undefined; const appName = getAppName(); + const metaDescription = getLabel("metaDescription"); const chartConfig = getChartConfig(); const sections = getSections(); const version = getReleases().length; @@ -32,6 +35,12 @@ const Home: CustomPage = () => { return ( <> + + {metaDescription && ( + + )} + +

{appName}{" "}