From 768bf449c46aa8f07f55f594e41cc6b8c8b52e83 Mon Sep 17 00:00:00 2001 From: Szepesi Tibor Date: Sat, 6 Jan 2024 21:20:19 +0100 Subject: [PATCH] Move meta from home page to app root --- src/app.tsx | 9 ++++++++- src/pages/Home.tsx | 5 ----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index fe873f4..5049098 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -2,11 +2,12 @@ import { ErrorBoundary, lazy, Suspense } from 'solid-js' import 'normalize.css' +import previewImage from '~/assets/preview_image.png' import '~/scss/global.scss' import Layout from '~/components/Layout' import Title from '~/components/Title' import { RouteDefinition, Router } from '@solidjs/router' -import { MetaProvider } from '@solidjs/meta' +import { Meta, MetaProvider } from '@solidjs/meta' import { loadHomePage } from './data/home.data' import { loadPost } from './data/post.data' import { loadSearchPage } from './data/search.data' @@ -74,6 +75,12 @@ export default function App() { null}> + <Meta name="og:site_name" content="Verseghy Ferenc Gimnázium" /> + <Meta name="og:type" content="website" /> + <Meta name="og:locale" content="hu_HU" /> + <Meta name="og:description" content="A szolnoki Verseghy Ferenc Gimnázium weboldala" /> + <Meta name="og:image" content={previewImage} /> + <Router root={Layout}>{ROUTES}</Router> </ErrorBoundary> </Suspense> diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 2c9fd1e..085626f 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,7 +1,6 @@ import { Component } from 'solid-js' import Banners from '~/components/Banners' import CardGrid from '~/components/CardGrid' -import previewImage from '~/assets/preview_image.png' import styles from './Home.module.scss' import { Meta } from '@solidjs/meta' import { createAsync, RouteSectionProps } from '@solidjs/router' @@ -12,10 +11,6 @@ const HomePage: Component<RouteSectionProps> = () => { return ( <> - <Meta name="og:site_name" content="Verseghy Ferenc Gimnázium" /> - <Meta name="og:type" content="website" /> - <Meta name="og:image" content={previewImage} /> - <Meta name="og:description" content="A szolnoki Verseghy Ferenc Gimnázium weboldala" /> <Meta name="twitter:card" content="summary" /> <div class={styles.container}>