Skip to content

Commit

Permalink
tool metatags
Browse files Browse the repository at this point in the history
  • Loading branch information
imradhe committed Sep 18, 2024
1 parent bcba1a3 commit 9da758f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions frontend/src/app/tools/[tool]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
import ToolComponent from "../../../../components/Dynamic/Tool";
import axios from "axios";
import { Metadata } from "next";

export const dynamicParams = true;

interface ToolType {
title: string;
}


export async function generateMetadata({ params }: { params: { tool: string } }): Promise<Metadata> {
const response = await axios.get(`https://admin.models.ai4bharat.org/tools/${params.tool}`);
const toolData = response.data;

return {
title: toolData.title,
description: toolData.description,
keywords: toolData.keywords,
openGraph: {
title: toolData.title,
description: toolData.description,
},
twitter: {
description: toolData.description,
card: "summary_large_image",
creator: "@ai4bharat",
},
};
}


export async function generateStaticParams() {
const response = await axios.get("https://admin.models.ai4bharat.org/tools/");

Expand Down

0 comments on commit 9da758f

Please sign in to comment.