Skip to content

Commit fed1163

Browse files
authored
meta/og tags (#35)
merged 1/29/26 by ted
1 parent 1478e19 commit fed1163

4 files changed

Lines changed: 35 additions & 2 deletions

File tree

messages/en.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
"common.mission.header": "Mission",
1212
"common.mission.desc" : "To facilitate community focused technology development and research in support of low-income, marginalized populations and groups.",
1313

14+
"meta.title" : "Seattle Community Network",
15+
"meta.description" : "The Seattle Community Network (SCN) is a community-run cellular (4G LTE) Internet access network dedicated to providing fair access to underserved communities all across the Puget Sound.",
16+
"meta.url" : "https://seattlecommunitynetwork.org",
17+
"meta.type" : "website",
18+
1419
"common.toggle_nav" : "toggle nav",
1520

1621
"common.nav.0.label" : "Home",

src/lib/assets/og-image.jpg

101 KB
Loading

src/lib/components/Metatags.svelte

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<script lang="ts">
2+
import { page } from '$app/state';
3+
4+
import { m } from '$lib/paraglide/messages.js';
5+
6+
import image from '$lib/assets/og-image.jpg';
7+
8+
const og = {
9+
title : m['meta.title'](),
10+
description : m['meta.description'](),
11+
url : m['meta.url']() + page.url.pathname,
12+
type : m['meta.type'](),
13+
image
14+
};
15+
</script>
16+
17+
<svelte:head>
18+
19+
<meta name="description" content="{m['meta.description']()}" />
20+
21+
{#each Object.entries(og) as [key, value]}
22+
<meta property={`og:${key}`} content={value} />
23+
{/each}
24+
25+
</svelte:head>

src/routes/+layout.svelte

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
<script lang="ts">
22
import '../app.css';
33
4-
import Header from '$lib/components/Header.svelte';
5-
import Footer from '$lib/components/Footer.svelte';
4+
import Header from '$lib/components/Header.svelte';
5+
import Footer from '$lib/components/Footer.svelte';
6+
import Metatags from '$lib/components/Metatags.svelte';
67
78
let { children } = $props();
89
</script>
910

11+
<Metatags />
12+
1013
<Header />
1114

1215
<main>

0 commit comments

Comments
 (0)