From 153a01aa476423e8ae17484dcbc20b54ab2775fb Mon Sep 17 00:00:00 2001 From: Mathieu Bastian Date: Sun, 13 Sep 2026 13:39:52 +0200 Subject: [PATCH 1/2] Add per-page SEO metadata (title, description, canonical, OG/Twitter tags) Every page previously shared the same hardcoded title, description, and canonical URL, so all plugin pages canonicalized to the homepage. Layout now accepts title/description/image/noindex props, computes a real canonical from the current URL, and emits Open Graph/Twitter tags. Also fixes html lang from "fr" to "en". Co-Authored-By: Claude Sonnet 5 --- src/layouts/Layout.astro | 40 +++++++++++++++++++++------ src/pages/404.astro | 2 +- src/pages/about/index.astro | 6 +++- src/pages/community/index.astro | 6 +++- src/pages/desktop/index.astro | 6 +++- src/pages/desktop/plugins/[id].astro | 11 +++++++- src/pages/desktop/plugins/index.astro | 6 +++- src/pages/faq/index.astro | 7 ++++- src/pages/lite/index.astro | 6 +++- src/pages/quickstart/index.astro | 7 ++++- src/pages/toolkit/index.astro | 6 +++- 11 files changed, 85 insertions(+), 18 deletions(-) diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index f0ebf8d..14f5658 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -8,9 +8,23 @@ import Donate from "../components/Donate.astro"; interface Props { class?: string; pageId?: string; + title?: string; + description?: string; + image?: string; + noindex?: boolean; } -const { class: className, pageId } = Astro.props; +const DEFAULT_TITLE = "Gephi - The Open Graph Viz Platform"; +const DEFAULT_DESCRIPTION = + "Gephi is the leading visualization and exploration software for all kinds of graphs and networks. Gephi is open-source and free."; +const DEFAULT_IMAGE = "/gephi-screenshot.jpg"; + +const { class: className, pageId, title, description, image, noindex } = Astro.props; + +const pageTitle = title ? `${title} | Gephi` : DEFAULT_TITLE; +const pageDescription = description || DEFAULT_DESCRIPTION; +const canonicalURL = new URL(Astro.url.pathname, Astro.site); +const ogImageURL = new URL(image || DEFAULT_IMAGE, Astro.site); const pages = [ { id: "about", href: "/about", title: "About" }, @@ -32,11 +46,11 @@ const appPages = [ --- - + - + @@ -44,11 +58,21 @@ const appPages = [ - - Gephi - The Open Graph Viz Platform + + {noindex && } + {pageTitle} + + + + + + + + + + + +