Adds per-page titles, meta descriptions, and the design favicon
Introduces pageHead() and siteHead in seo.ts for title, description, and Open Graph tags, rendered through TanStack Router's HeadContent. Home and Over mij get their own title and description. index.html now uses lang="nl" and carries fallback tags for crawlers without JavaScript; main.tsx removes them on startup to avoid duplicates. Replaces the Vite favicon with the design's favicon.png (also as apple-touch-icon). Remaining SEO work is tracked in Gitea issue #1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #2.
This commit is contained in:
+15
-3
@@ -1,10 +1,22 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<html lang="nl">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<link rel="apple-touch-icon" href="/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>andrea-slop-fotografie</title>
|
||||
<!--
|
||||
Fallback voor crawlers en link-previews die geen JavaScript uitvoeren.
|
||||
Zodra de app start, worden deze tags verwijderd (zie main.tsx) en zet
|
||||
elke route zijn eigen titel en beschrijving (zie src/seo.ts).
|
||||
-->
|
||||
<title data-fallback>Lifestyle fotograaf in Huizen | Andrea Slop Fotografie</title>
|
||||
<meta data-fallback name="description" content="Lifestyle fotograaf in Huizen en omgeving. Ik leg je mooiste momenten vast in spontane, kleurrijke foto's. Voor loveshoots, gezins- en zwangerschapsshoots." />
|
||||
<meta data-fallback property="og:site_name" content="Andrea Slop Fotografie" />
|
||||
<meta data-fallback property="og:locale" content="nl_NL" />
|
||||
<meta data-fallback property="og:type" content="website" />
|
||||
<meta data-fallback property="og:title" content="Lifestyle fotograaf in Huizen | Andrea Slop Fotografie" />
|
||||
<meta data-fallback property="og:description" content="Lifestyle fotograaf in Huizen en omgeving. Ik leg je mooiste momenten vast in spontane, kleurrijke foto's. Voor loveshoots, gezins- en zwangerschapsshoots." />
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 9.3 KiB |
@@ -21,6 +21,10 @@ declare module '@tanstack/react-router' {
|
||||
}
|
||||
}
|
||||
|
||||
// De statische head-tags uit index.html zijn alleen voor crawlers zonder
|
||||
// JavaScript. Vanaf hier beheren de routes ze, dus voorkom dubbele tags.
|
||||
document.querySelectorAll('head [data-fallback]').forEach((el) => el.remove());
|
||||
|
||||
// Render the app
|
||||
const rootElement = document.getElementById('root')!;
|
||||
if (!rootElement.innerHTML) {
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
import { createRootRoute } from '@tanstack/react-router';
|
||||
import { createRootRoute, HeadContent } from '@tanstack/react-router';
|
||||
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools';
|
||||
import AppShell from '../components/AppShell';
|
||||
import { siteHead } from '../seo';
|
||||
|
||||
const RootLayout = () => (
|
||||
<>
|
||||
{/* Titel en meta-tags van de actieve route; React zet ze in <head> */}
|
||||
<HeadContent />
|
||||
<AppShell />
|
||||
<TanStackRouterDevtools />
|
||||
</>
|
||||
);
|
||||
|
||||
export const Route = createRootRoute({ component: RootLayout });
|
||||
export const Route = createRootRoute({
|
||||
head: () => siteHead,
|
||||
component: RootLayout,
|
||||
});
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
import Hero from '../components/Hero/Hero';
|
||||
import heroContent from '../components/Hero/heroContent';
|
||||
import { pageHead } from '../seo';
|
||||
|
||||
export const Route = createFileRoute('/')({
|
||||
head: () =>
|
||||
pageHead({
|
||||
title: 'Lifestyle fotograaf in Huizen | Andrea Slop Fotografie',
|
||||
description:
|
||||
"Lifestyle fotograaf in Huizen en omgeving. Ik leg je mooiste momenten vast in spontane, kleurrijke foto's. Voor loveshoots, gezins- en zwangerschapsshoots.",
|
||||
}),
|
||||
component: Index,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import { pageHead } from "../seo";
|
||||
|
||||
export const Route = createFileRoute("/over-mij")({
|
||||
head: () =>
|
||||
pageHead({
|
||||
title: "Over mij | Andrea Slop Fotografie",
|
||||
description:
|
||||
"Hi! Ik ben Andrea, lifestyle fotograaf uit Huizen. Ik leg jullie vast zoals jullie zijn: spontaan en natuurlijk, zonder ongemakkelijke poses.",
|
||||
}),
|
||||
component: About,
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// Head-tags per pagina, voor de `head`-optie van een route. Titel en
|
||||
// beschrijving komen later uit het CMS.
|
||||
//
|
||||
// Richtlijn: titel max. ~60 tekens, beschrijving max. ~155 tekens; daarna
|
||||
// kort Google ze af in de zoekresultaten.
|
||||
export function pageHead({
|
||||
title,
|
||||
description,
|
||||
}: {
|
||||
title: string;
|
||||
description: string;
|
||||
}) {
|
||||
return {
|
||||
meta: [
|
||||
{ title },
|
||||
{ name: 'description', content: description },
|
||||
// Voor link-previews (WhatsApp, Facebook, LinkedIn)
|
||||
{ property: 'og:title', content: title },
|
||||
{ property: 'og:description', content: description },
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
// Tags die voor de hele site gelden
|
||||
export const siteHead = {
|
||||
meta: [
|
||||
{ property: 'og:site_name', content: 'Andrea Slop Fotografie' },
|
||||
{ property: 'og:locale', content: 'nl_NL' },
|
||||
{ property: 'og:type', content: 'website' },
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user