Skip to content

Commit 0fb9163

Browse files
aaronpowellCopilot
andauthored
Fix website social metadata (#1054)
Add default Starlight description metadata and wire the existing social image into Open Graph and Twitter tags so shared links render a proper preview. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent d313778 commit 0fb9163

2 files changed

Lines changed: 52 additions & 2 deletions

File tree

website/astro.config.mjs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,50 @@ import starlight from "@astrojs/starlight";
33
import { defineConfig } from "astro/config";
44
import pagefindResources from "./src/integrations/pagefind-resources";
55

6+
const site = "https://awesome-copilot.github.com/";
7+
const siteDescription =
8+
"Community-contributed agents, instructions, and skills to enhance your GitHub Copilot experience";
9+
const socialImageUrl = new URL("/images/social-image.png", site).toString();
10+
611
// https://astro.build/config
712
export default defineConfig({
8-
site: "https://awesome-copilot.github.com/",
13+
site,
914
base: "/",
1015
output: "static",
1116
integrations: [
1217
starlight({
1318
title: "Awesome GitHub Copilot",
19+
description: siteDescription,
1420
social: [
1521
{
1622
icon: "github",
1723
label: "GitHub",
1824
href: "https://github.com/github/awesome-copilot",
1925
},
2026
],
27+
head: [
28+
{
29+
tag: "meta",
30+
attrs: {
31+
property: "og:image",
32+
content: socialImageUrl,
33+
},
34+
},
35+
{
36+
tag: "meta",
37+
attrs: {
38+
property: "og:image:alt",
39+
content: siteDescription,
40+
},
41+
},
42+
{
43+
tag: "meta",
44+
attrs: {
45+
name: "twitter:image",
46+
content: socialImageUrl,
47+
},
48+
},
49+
],
2150
customCss: ["./src/styles/starlight-overrides.css", "./src/styles/global.css"],
2251
editLink: {
2352
baseUrl:

website/src/pages/index.astro

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,28 @@ import Modal from '../components/Modal.astro';
55
const base = import.meta.env.BASE_URL;
66
---
77

8-
<StarlightPage frontmatter={{ title: 'Awesome GitHub Copilot', template: 'splash', pagefind: false, prev: false, next: false, editUrl: false }} hasSidebar={false}>
8+
<StarlightPage
9+
frontmatter={{
10+
title: 'Awesome GitHub Copilot',
11+
description:
12+
'Community-contributed agents, instructions, and skills to enhance your GitHub Copilot experience',
13+
template: 'splash',
14+
pagefind: false,
15+
prev: false,
16+
next: false,
17+
editUrl: false,
18+
head: [
19+
{
20+
tag: 'meta',
21+
attrs: {
22+
property: 'og:type',
23+
content: 'website',
24+
},
25+
},
26+
],
27+
}}
28+
hasSidebar={false}
29+
>
930
<div id="main-content">
1031
<!-- Hero Section -->
1132
<section class="hero" aria-labelledby="hero-heading">

0 commit comments

Comments
 (0)