Skip to content

Commit a433750

Browse files
committed
docs: add og image
1 parent d372739 commit a433750

File tree

5 files changed

+38
-1
lines changed

5 files changed

+38
-1
lines changed

docs/astro.config.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
import starlight from '@astrojs/starlight'
22
import { defineConfig } from 'astro/config'
33

4+
const site =
5+
process.env['VERCEL_ENV'] !== 'production' && process.env['VERCEL_URL']
6+
? `https://${process.env['VERCEL_URL']}`
7+
: 'https://starlight-typedoc.vercel.app/'
8+
49
export default defineConfig({
510
integrations: [
611
starlight({
712
customCss: ['./src/styles/custom.css'],
813
editLink: {
914
baseUrl: 'https://github.com/HiDeoo/starlight-typedoc/edit/main/docs/',
1015
},
16+
head: [
17+
{
18+
tag: 'meta',
19+
attrs: { property: 'og:image', content: new URL('og.jpg', site).href },
20+
},
21+
{
22+
tag: 'meta',
23+
attrs: {
24+
property: 'og:image:alt',
25+
content: 'Starlight plugin to generate documentation from TypeScript using TypeDoc.',
26+
},
27+
},
28+
],
1129
sidebar: [
1230
{
1331
label: 'Start Here',
@@ -39,4 +57,5 @@ export default defineConfig({
3957
title: 'Starlight TypeDoc',
4058
}),
4159
],
60+
site,
4261
})

docs/public/og.jpg

49.7 KB
Loading

example/astro.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,31 @@ import starlight from '@astrojs/starlight'
22
import { defineConfig } from 'astro/config'
33
import starlightTypeDoc, { typeDocSidebarGroup } from 'starlight-typedoc'
44

5+
const site =
6+
process.env['VERCEL_ENV'] !== 'production' && process.env['VERCEL_URL']
7+
? `https://${process.env['VERCEL_URL']}`
8+
: 'https://starlight-typedoc-example.vercel.app/'
9+
510
export default defineConfig({
611
integrations: [
712
starlight({
813
customCss: ['./src/styles/custom.css'],
914
editLink: {
1015
baseUrl: 'https://github.com/HiDeoo/starlight-typedoc/edit/main/example/',
1116
},
17+
head: [
18+
{
19+
tag: 'meta',
20+
attrs: { property: 'og:image', content: new URL('og.jpg', site).href },
21+
},
22+
{
23+
tag: 'meta',
24+
attrs: {
25+
property: 'og:image:alt',
26+
content: 'Starlight plugin to generate documentation from TypeScript using TypeDoc.',
27+
},
28+
},
29+
],
1230
plugins: [
1331
starlightTypeDoc({
1432
entryPoints: ['../fixtures/basics/src/index.ts'],

example/public/favicon.svg

Lines changed: 1 addition & 1 deletion
Loading

example/public/og.jpg

49.7 KB
Loading

0 commit comments

Comments
 (0)