Skip to content

Commit c010c1a

Browse files
authored
feat: add a social card for the site root (#165)
* feat: add a social card for the site root Starlight already emits `twitter:card: summary_large_image` on every page, but nothing ever set `og:image`, so sharing the root anywhere - Slack, Discord, X, LinkedIn - produced a bare text link with no card at all. Add a 1200x630 card built from the frontpage's own vocabulary: the cream paper background, the wordmark, the hero headline in the display serif, and the three supported platforms. It carries no distro name and no version, so a new release never leaves it stale, and no URL, since the site may not always live at robostack.github.io. The card is rendered by hand rather than at build time, which would mean pulling in a renderer just for one static image. scripts/og-image.html is the source and its header comment carries the render command. The tags land on the root page only; Starlight already emits the title, description and URL, so only the image, its dimensions and its alt text are missing. * feat: put the social card as a global property (every page)
1 parent 71a1ba7 commit c010c1a

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

‎astro.config.mjs‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import { defineConfig } from "astro/config";
33
import starlight from "@astrojs/starlight";
44
import svelte from "@astrojs/svelte";
55

6+
const site = "https://robostack.github.io";
7+
const ogImage = new URL("/og.png", site).href;
8+
69
export default defineConfig({
7-
site: "https://robostack.github.io",
10+
site,
811
// Published URLs are `GettingStarted.html`, not `GettingStarted/`. Don't change this.
912
build: { format: "file" },
1013
integrations: [
@@ -22,6 +25,17 @@ export default defineConfig({
2225
tag: "link",
2326
attrs: { rel: "apple-touch-icon", href: "/apple-touch-icon.png" },
2427
},
28+
{ tag: "meta", attrs: { property: "og:image", content: ogImage } },
29+
{ tag: "meta", attrs: { property: "og:image:width", content: "1200" } },
30+
{ tag: "meta", attrs: { property: "og:image:height", content: "630" } },
31+
{
32+
tag: "meta",
33+
attrs: {
34+
property: "og:image:alt",
35+
content:
36+
"RoboStack - Manage ROS with ease. Any ROS distro, in an isolated per-project environment, on Linux, macOS and Windows.",
37+
},
38+
},
2539
],
2640
social: [
2741
{

‎public/og.png‎

33.5 KB
Loading

0 commit comments

Comments
 (0)