Skip to content

Add Open Graph meta tags for link previews #138

Open

Description

@disconsented

Add Open Graph meta tags so that a Workshop Walker link shows a preview card in Discord (and other sites that read Open Graph). Discord docs: https://docs.discord.com/developers/link-previews/overview#quick-start

Tags to add (no image):

<meta property="og:site_name" content="Workshop Walker">
<meta property="og:title" content="...">
<meta property="og:description" content="...">
<meta name="theme-color" content="#......">
<meta name="twitter:card" content="summary">

Leave out og:image, og:image:width and og:image:height. Use summary for twitter:card, because summary_large_image needs an image.

The UI cannot do this alone. ui/src/routes/+layout.ts sets ssr = false, and ui/svelte.config.js uses adapter-static with fallback: 'index.html'. Thus every route gets the same empty shell, and the tags come only after the JS runs. The Discord crawler does not run JS, so tags in <svelte:head> have no effect.

Two levels of work:

  1. Static tags in ui/src/app.html. The site name, a general title and description, and the theme colour. This is small and gives a card for every link.
  2. Tags for each page, for /app/{id} and /item/{item}. The backend must put them into the HTML. At this time src/web/mod.rs serves ui/build/ through StaticDir with .fallback("index.html"). Add a Salvo handler for these two routes in front of StaticDir. The handler gets the app or item name and a short description, then puts the tags into index.html before it sends the page. Escape the values as HTML attributes. The item description comes from Steam, so use the plain text, not the BB output, and cut it to approximately 200 characters. If the lookup fails, send the static shell from step 1.

Make sure that the static tags from step 1 do not also appear on pages that get tags from step 2. Discord can choose the wrong pair.

Test with the Discord embed debugger or with curl -A "Mozilla/5.0 (compatible; Discordbot/2.0; +https://discordapp.com)" on an app URL and an item URL.


Claude (AI) wrote this issue from a request by the maintainer. Check the details before you act on them.

Activity

  1. added
    enhancement
    on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions