Skip to content

feat(meta): add Open Graph and Twitter link-preview metadata - #456

Merged
kNoAPP merged 2 commits into
developfrom
kNoAPP/451-feat-link-preview-metadata
Sep 26, 2026
Merged

kNoAPP merged 2 commits into
developfrom
kNoAPP/451-feat-link-preview-metadata

Conversation

@kNoAPP

@kNoAPP kNoAPP commented Sep 26, 2026

Copy link
Copy Markdown
Owner

Description

A kn0.app link pasted into Discord, Slack, X or LinkedIn gets a bare link today. The page metadata had no Open Graph or Twitter tags and no metadataBase. This PR adds the metadata half of #451. The preview image comes in a follow-up, because it's exported from #450's social card and that artwork doesn't exist yet.

app/layout.tsx

  • metadataBase: new URL('https://kn0.app') (matches public/CNAME), so the image URL added later comes out absolute.
  • openGraph: type: 'website', siteName, title, description, url: '/', locale: 'en_US'.
  • twitter: { card: 'summary_large_image' }. Next fills twitter:title and twitter:description from the Open Graph fields, so they aren't repeated.
  • viewport.themeColor: '#4f8ef7' (dark-theme --accent). This is a plain theme-color with no media attribute, which Discord uses to color the embed's side bar. A comment asks feat(pwa): make the app installable as a desktop app #446 to keep it as the first entry when it adds the per-scheme light and dark entries.
  • New description, 117 characters: "Message, map and manage your MeshCore LoRa radio from the browser over USB, Bluetooth or WiFi. No account, no server."
  • The app name and description live in one constant each (APP_NAME and APP_DESCRIPTION), so a rename touches one line.

public/manifest.webmanifest: now has the same description, so the install prompt and the link preview say the same thing.

Verification

npm run build → out/index.html contains:

<meta name="theme-color" content="#4f8ef7"/>
<meta name="description" content="Message, map and manage your MeshCore LoRa radio …"/>
<meta property="og:title" content="MeshCore Desktop"/>
<meta property="og:description" content="Message, map and manage …"/>
<meta property="og:url" content="https://kn0.app/"/>
<meta property="og:site_name" content="MeshCore Desktop"/>
<meta property="og:locale" content="en_US"/>
<meta property="og:type" content="website"/>
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:title" content="MeshCore Desktop"/>
<meta name="twitter:description" content="Message, map and manage …"/>

Lint, type-check, spell-check and build all pass. There's no visible UI change, so there are no screenshots, and no radio behavior is involved.

Still to do for #451 (after #450 lands)

  • Add app/opengraph-image.png (1200×630, well under 1 MB) with opengraph-image.alt.txt. og:image, its width, height and alt, and the X image will then appear automatically.
  • After deploy, paste the link into Discord and check it with opengraph.xyz and LinkedIn Post Inspector.
  • The maintainer uploads the repo-social PNG under the repository's Settings → Social preview.

Heads-up: a plain accent theme-color also tints browser chrome in browsers that honor it, like Safari's tab bar and mobile Chrome. That's the trade-off the ticket chose to get the Discord accent.

Issues

Type of Change

  • ❌ ! -- Breaking change (fix or feature that would cause existing
    functionality to change)
  • ✨ feat -- New feature (non-breaking change which adds functionality)
  • 🛠️ fix -- Bug fix (non-breaking change which fixes an issue)
  • 📝 docs -- Additional or updated documentation
  • 🎨 style -- Code style changes (formatting, missing semi colons, etc)
  • 🧹 refactor -- Code refactor
  • ⚡ perf -- Performance improvement
  • 🧪 test -- Tests (adding or updating tests)
  • 🏗️ build -- Build system or external dependencies changes
  • ✅ ci -- Build configuration change
  • 🗑️ chore -- Grunt tasks
  • ⏪ revert -- Revert previous changes

Set metadataBase to https://kn0.app so preview URLs are absolute, add
openGraph and a summary_large_image twitter card, and a plain brand
accent theme-color for Discord's embed side bar. Sharpen the page and
manifest description, and keep the app name in one constant in the
layout.

The preview image follows once the #450 social card exists.

Part of #451
@github-actions github-actions Bot added the ui label Sep 26, 2026
@kNoAPP
kNoAPP merged commit 1bcca5e into develop Sep 26, 2026
8 checks passed
@kNoAPP
kNoAPP deleted the kNoAPP/451-feat-link-preview-metadata branch September 26, 2026 19:38
@github-actions github-actions Bot mentioned this pull request Sep 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant