add canonical link to templates (#327)

This commit is contained in:
Guy Ben-Aharon
2024-11-05 10:54:05 +02:00
committed by GitHub
parent d8a20ebbd9
commit 3d3efc5e82
2 changed files with 10 additions and 0 deletions

View File

@@ -69,6 +69,12 @@ const TemplatePageComponent: React.FC = () => {
Database schema diagram for {template.name} |
ChartDB
</title>
{HOST_URL !== 'https://chartdb.io' ? (
<link
rel="canonical"
href={`https://chartdb.io/templates/${templateSlug}`}
/>
) : null}
<meta
name="title"
content={`Database schema for - ${template.name} | ChartDB`}

View File

@@ -11,6 +11,7 @@ import { useLoaderData, useMatches, useParams } from 'react-router-dom';
import type { Template } from '@/templates-data/templates-data';
import { Spinner } from '@/components/spinner/spinner';
import { Helmet } from 'react-helmet-async';
import { HOST_URL } from '@/lib/env';
export interface TemplatesPageLoaderData {
templates: Template[] | undefined;
@@ -33,6 +34,9 @@ const TemplatesPageComponent: React.FC = () => {
<>
<Helmet>
<title>ChartDB - Database Schema Templates</title>
{HOST_URL !== 'https://chartdb.io' ? (
<link rel="canonical" href="https://chartdb.io/templates" />
) : null}
</Helmet>
<section className="flex w-screen flex-col bg-background">