mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: page exclusive titles
This commit is contained in:
1 parent
e834d31d92
commit
ce5c9f4afa
2 files changed
+15
-9
No files matched your search
@@ -15,21 +15,26 @@ export default function ToolsLayout({ children }: ToolsLayoutProps) {
|
||||
const pathname = usePathname();
|
||||
const pathSplit = pathname.split('/');
|
||||
const toolId = pathSplit.at(2);
|
||||
const isToolRoot = pathname === `/tools/${toolId}`;
|
||||
const tool = TOOLS.find((tool) => tool.id === toolId);
|
||||
|
||||
return (
|
||||
<>
|
||||
{tool && (
|
||||
<>
|
||||
<title>{tool.title}</title>
|
||||
{tool.pageDescription !== undefined && (
|
||||
<meta name="description" content={tool.pageDescription} />
|
||||
)}
|
||||
{isToolRoot && (
|
||||
<>
|
||||
<title>{tool.title}</title>
|
||||
<meta
|
||||
property="og:image"
|
||||
content={`/assets/banners/${toolId}.webp`}
|
||||
/>
|
||||
|
||||
<meta
|
||||
property="og:image"
|
||||
content={`/assets/banners/${toolId}.webp`}
|
||||
/>
|
||||
{tool.pageDescription !== undefined && (
|
||||
<meta name="description" content={tool.pageDescription} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
Reference in new issue
Block a user