Skip to content

Commit 2f9e75a

Browse files
committed
docs: add og tags
1 parent aed4133 commit 2f9e75a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/.vitepress/config.mts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ export default defineConfig({
1818
head: [
1919
['link', { rel: 'icon', href: `/${packageName}/logo.png` }],
2020
],
21+
transformHead: ({ pageData, head }) => {
22+
head.push(['meta', { property: 'og:site_name', content: packageName }]);
23+
head.push(['meta', { property: 'og:title', content: pageData.title }]);
24+
if (pageData.description) {
25+
head.push(['meta', { property: 'og:description', content: pageData.description }]);
26+
}
27+
head.push(['meta', { property: 'og:image', content: `https://${author}.github.io/${packageName}/logo.png` }]);
28+
29+
return head
30+
},
2131
themeConfig: {
2232
logo: '/logo.png',
2333
search: {

0 commit comments

Comments
 (0)