Skip to content

Commit

Permalink
Fix incorrect meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Jan 18, 2024
1 parent 7b5bfee commit 02fd0e7
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
12 changes: 11 additions & 1 deletion components/CategoryPage/CategoryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,20 @@ export function CategoryPage({ category, components }: CategoryPageProps) {
<ComponentCanvas {...component} key={component.slug} zIndex={components.length - index} />
));

const title = `${category.name} | Mantine UI`;

return (
<Shell>
<Head>
<title>{`${category.name} | Mantine UI`}</title>
<title>{title}</title>
<meta itemProp="name" content={title} key="item-title" />
<meta property="og:title" content={title} key="og-title" />
<meta name="twitter:title" content={title} key="twitter-title" />
<meta
property="og:url"
content={`https://ui.mantine.dev/category/${category.slug}`}
key="og-url"
/>
</Head>
<Container size="xl" mt={50}>
<CategoryHeader category={category} />
Expand Down
12 changes: 11 additions & 1 deletion components/ComponentPage/ComponentPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,20 @@ export function ComponentPage({ data }: ComponentPageProps) {
const [state, setState] = useState('preview');
const [primaryColor, setPrimaryColor] = useState('blue');

const title = `${data.attributes.title} | Mantine UI`;

return (
<>
<Head>
<title>{`${data.attributes.title} | Mantine UI`}</title>
<title>{title}</title>
<meta itemProp="name" content={title} key="item-title" />
<meta property="og:title" content={title} key="og-title" />
<meta name="twitter:title" content={title} key="twitter-title" />
<meta
property="og:url"
content={`https://ui.mantine.dev/component/${data.slug}`}
key="og-url"
/>
</Head>

<ComponentPreviewControls
Expand Down
4 changes: 0 additions & 4 deletions components/HomePage/HomePage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Head from 'next/head';
import { CATEGORIES } from '../../data';
import { Shell } from '../Shell';
import { Banner } from './Banner/Banner';
Expand All @@ -16,9 +15,6 @@ export function HomePage({ componentsCountByCategory }: HomePageProps) {

return (
<Shell>
<Head>
<title>Mantine UI</title>
</Head>
<Banner componentsCount={allComponentsCount} />
<div id="main">
<CategoriesList groups={CATEGORIES} componentsCountByCategory={componentsCountByCategory} />
Expand Down
17 changes: 17 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ export default function App({ Component, pageProps }: any) {
<>
<Head>
<title>Mantine UI</title>
<meta itemProp="name" content="Mantine UI" key="item-title" />
<meta property="og:title" content="Mantine UI" key="og-title" />
<meta name="twitter:title" content="Mantine UI" key="twitter-title" />
<meta property="og:url" content="https://ui.mantine.dev/" key="og-url" />
<link rel="shortcut icon" href="/favicon.svg" />
<meta name="language" content="English" />
<meta name="robots" content="index, follow" />
<meta name="keywords" content="react,mantine,components" />
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, user-scalable=no"
Expand All @@ -41,6 +48,16 @@ export default function App({ Component, pageProps }: any) {
name="og:image"
content="https://raw.githubusercontent.com/mantinedev/mantine/master/.demo/social-preview.png"
/>
<meta
name="twitter:image"
content="https://raw.githubusercontent.com/mantinedev/mantine/master/.demo/social-preview.png"
/>
<meta
itemProp="image"
content="http://raw.githubusercontent.com/mantinedev/mantine/master/.demo/social-preview.png"
/>
<meta itemProp="description" content="120+ prebuilt components with Mantine" />
<meta name="description" content="120+ prebuilt components with Mantine" />
</Head>
<GaScript />

Expand Down

0 comments on commit 02fd0e7

Please sign in to comment.