Skip to content

Commit

Permalink
feat: add configurable meta description for homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasschopmans committed Mar 26, 2024
1 parent d254ec1 commit 8c407ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data/config.default.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": ""
}
}
9 changes: 9 additions & 0 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Head from "next/head";
import { useRouter } from "next/router";

import { QuadrantList } from "@/components/QuadrantList/QuadrantList";
Expand All @@ -7,6 +8,7 @@ import {
getAppName,
getChartConfig,
getItems,
getLabel,
getQuadrants,
getReleases,
getRings,
Expand All @@ -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;
Expand All @@ -32,6 +35,12 @@ const Home: CustomPage = () => {

return (
<>
<Head>
{metaDescription && (
<meta name="description" content={metaDescription} />
)}
</Head>

<h1>
{appName}{" "}
<span style={{ color: "var(--highlight)", whiteSpace: "nowrap" }}>
Expand Down

0 comments on commit 8c407ca

Please sign in to comment.