Skip to content

Commit 8691d1d

Browse files
authored
Merge pull request #82 from gephi/seo-per-page-metadata
Add per-page SEO metadata (title, description, canonical, OG/Twitter tags)
2 parents 9ddae8c + 5f56ffb commit 8691d1d

11 files changed

Lines changed: 80 additions & 18 deletions

File tree

‎src/layouts/Layout.astro‎

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,23 @@ import Donate from "../components/Donate.astro";
88
interface Props {
99
class?: string;
1010
pageId?: string;
11+
title?: string;
12+
description?: string;
13+
image?: string;
14+
noindex?: boolean;
1115
}
1216
13-
const { class: className, pageId } = Astro.props;
17+
const DEFAULT_TITLE = "Gephi - The Open Graph Viz Platform";
18+
const DEFAULT_DESCRIPTION =
19+
"Gephi is the leading visualization and exploration software for all kinds of graphs and networks. Gephi is open-source and free.";
20+
const DEFAULT_IMAGE = "/gephi-screenshot.jpg";
21+
22+
const { class: className, pageId, title, description, image, noindex } = Astro.props;
23+
24+
const pageTitle = title ? `${title} | Gephi` : DEFAULT_TITLE;
25+
const pageDescription = description || DEFAULT_DESCRIPTION;
26+
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
27+
const ogImageURL = new URL(image || DEFAULT_IMAGE, Astro.site);
1428
1529
const pages = [
1630
{ id: "about", href: "/about", title: "About" },
@@ -32,23 +46,33 @@ const appPages = [
3246
---
3347

3448
<!doctype html>
35-
<html lang="fr">
49+
<html lang="en">
3650
<head>
3751
<meta charset="UTF-8" />
3852
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
39-
<link rel="canonical" href="https://gephi.org" />
53+
<link rel="canonical" href={canonicalURL} />
4054
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
4155
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
4256
<link rel="shortcut icon" href="/favicon.ico" />
4357
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
4458
<meta name="apple-mobile-web-app-title" content="MyWebSite" />
4559
<link rel="manifest" href="/site.webmanifest" />
4660
<link rel="sitemap" href="/sitemap-index.xml" />
47-
<meta
48-
name="description"
49-
content="Gephi is the leading visualization and exploration software for all kinds of graphs and networks. Gephi is open-source and free."
50-
/>
51-
<title>Gephi - The Open Graph Viz Platform</title>
61+
<meta name="description" content={pageDescription} />
62+
{noindex && <meta name="robots" content="noindex" />}
63+
<title>{pageTitle}</title>
64+
65+
<meta property="og:type" content="website" />
66+
<meta property="og:site_name" content="Gephi" />
67+
<meta property="og:url" content={canonicalURL} />
68+
<meta property="og:title" content={pageTitle} />
69+
<meta property="og:description" content={pageDescription} />
70+
<meta property="og:image" content={ogImageURL} />
71+
72+
<meta name="twitter:card" content="summary_large_image" />
73+
<meta name="twitter:title" content={pageTitle} />
74+
<meta name="twitter:description" content={pageDescription} />
75+
<meta name="twitter:image" content={ogImageURL} />
5276
</head>
5377
<body class={className}>
5478
<nav class="navbar navbar-expand-md">

‎src/pages/404.astro‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Banner from "../components/Banner.astro";
44
import Layout from "../layouts/Layout.astro";
55
---
66

7-
<Layout>
7+
<Layout title="Page Not Found" description="The page you were looking for could not be found on gephi.org." noindex>
88
<Banner>
99
<h1><Icon name="ph:link-break" /> Something about Gephi could not be found!</h1>
1010
</Banner>

‎src/pages/about/index.astro‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ const TEAM: TeamMember[] = [
3232
];
3333
---
3434

35-
<Layout pageId="about">
35+
<Layout
36+
pageId="about"
37+
title="About"
38+
description="Learn about Gephi's history, the team behind the open-source graph visualization platform, and how the project is run."
39+
>
3640
<Banner>
3741
<h1>About Gephi</h1>
3842
</Banner>

‎src/pages/community/index.astro‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ const GEPHI_WEEKS = [
4141
];
4242
---
4343

44-
<Layout pageId="community">
44+
<Layout
45+
pageId="community"
46+
title="Community"
47+
description="Join the Gephi community: newsletter, forums, social media and events for users and contributors of the open graph viz platform."
48+
>
4549
<Banner>
4650
<h1>Gephi Community</h1>
4751
</Banner>

‎src/pages/desktop/index.astro‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ import realtime01 from "../../images/desktop/realtime_01.png";
1414
import realtime02 from "../../images/desktop/realtime_02.png";
1515
---
1616

17-
<Layout pageId="desktop">
17+
<Layout
18+
pageId="desktop"
19+
title="Gephi Desktop"
20+
description="Gephi is an open-source desktop application to visually analyze and explore networks and graphs. Free download for Windows, macOS and Linux."
21+
>
1822
<style>
1923
:root {
2024
--bs-primary: var(--bs-gephi-desktop-logo);

‎src/pages/desktop/plugins/[id].astro‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ export async function getStaticPaths() {
3333
3434
const { plugin, latestGephiVersion } = Astro.props;
3535
36+
const pluginImage = plugin.images?.[0]
37+
? `https://raw.githubusercontent.com/gephi/gephi-plugins/refs/heads/gh-pages/plugins/${plugin.images[0].image}`
38+
: undefined;
39+
3640
let readme = "";
3741
try {
3842
readme = await marked(plugin.readme);
@@ -50,7 +54,7 @@ const topVersionTag = modernVersionTags[0];
5054
const topVersionIsLatestGephi = !!topVersionTag && topVersionTag === latestGephiVersion;
5155
---
5256

53-
<Layout class="plugin-page">
57+
<Layout class="plugin-page" title={plugin.name} description={plugin.short_description} image={pluginImage}>
5458
<Banner className="py-4">
5559
<div class="banner-top">
5660
<a class="text-white" href="/desktop">Gephi</a> > <a class="text-white" href="/desktop/plugins">Gephi plugins</a> >

‎src/pages/desktop/plugins/index.astro‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ const pluginsData: Plugin[] | null = pluginsDataRequest.ok
2222
const defaultVisibleCount = pluginsData?.filter(pluginHasModernVersion).length ?? 0;
2323
---
2424

25-
<Layout pageId="desktop-plugins">
25+
<Layout
26+
pageId="desktop-plugins"
27+
title="Gephi Plugins"
28+
description="Browse community-developed plugins for Gephi, the open graph viz platform, or learn how to create and share your own."
29+
>
2630
<Banner>
2731
<div class="banner-contents">
2832
<div class="banner-texts">

‎src/pages/faq/index.astro‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,12 @@ const QUESTIONS: Group<Question | Group<Question>>[] = [
288288
];
289289
---
290290

291-
<Layout class="faq-page" pageId="faq">
291+
<Layout
292+
class="faq-page"
293+
pageId="faq"
294+
title="FAQ"
295+
description="Answers to frequently asked questions about Gephi, the open-source network visualization and exploration software."
296+
>
292297
<Banner containerClass="my-5 py-4">
293298
<h1>Frequently Asked Questions</h1>
294299
<p class="fs-5 mb-1">

‎src/pages/lite/index.astro‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ import Responsive from "../../images/lite/responsiveness.jpg";
1616
import Retina from "../../images/lite/retina.png";
1717
---
1818

19-
<Layout pageId="lite">
19+
<Layout
20+
pageId="lite"
21+
title="Gephi Lite"
22+
description="Gephi Lite is an open-source web application dedicated to visual network analysis. Works on desktop, tablets and mobiles, no install required."
23+
>
2024
<style>
2125
:root {
2226
--bs-primary: var(--bs-gephi-lite-bg);

‎src/pages/quickstart/index.astro‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ import GephiLite from "../../components/quickstart/GephiLite.md";
77
import Layout from "../../layouts/Layout.astro";
88
---
99

10-
<Layout class="no-sticky-nav" pageId="quickstart">
10+
<Layout
11+
class="no-sticky-nav"
12+
pageId="quickstart"
13+
title="Quickstart"
14+
description="Get started quickly with Gephi: install the software and learn the basics of visualizing and exploring your first network."
15+
>
1116
<Banner>
1217
<h1>Quickstart</h1>
1318
</Banner>

0 commit comments

Comments
 (0)