Skip to content

Commit aadc2e9

Browse files
committed
feat: og
1 parent bf12a6b commit aadc2e9

File tree

6 files changed

+322
-8
lines changed

6 files changed

+322
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ dist/
9999
.vitepress/dist
100100
.vitepress/cache
101101
.vitepress/.temp
102+
src/public/og
102103

103104
# Serverless directories
104105
.serverless/

.vitepress/config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import {
1414
groupIconMdPlugin,
1515
groupIconVitePlugin
1616
} from 'vitepress-plugin-group-icons'
17+
import { addOgImage } from 'vitepress-plugin-og'
18+
import { withCtx } from 'vue'
1719

1820
const nav: ThemeConfig['nav'] = [
1921
{
@@ -610,15 +612,7 @@ export default defineConfigWithTheme<ThemeConfig>({
610612
content: 'Vue.js - The Progressive JavaScript Framework'
611613
}
612614
],
613-
[
614-
'meta',
615-
{
616-
property: 'og:image',
617-
content: 'https://vuejs.org/images/logo.png'
618-
}
619-
],
620615
['meta', { name: 'twitter:site', content: '@vuejs' }],
621-
['meta', { name: 'twitter:card', content: 'summary' }],
622616
[
623617
'link',
624618
{
@@ -759,6 +753,12 @@ export default defineConfigWithTheme<ThemeConfig>({
759753
}
760754
},
761755

756+
async transformPageData(pageData, ctx) {
757+
await addOgImage(pageData, ctx, {
758+
domain: 'https://vuejs.org',
759+
})
760+
},
761+
762762
markdown: {
763763
theme: 'github-dark',
764764
config(md) {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"typescript": "^5.6.3",
2626
"vitepress-plugin-group-icons": "^1.5.4",
2727
"vitepress-plugin-llms": "^0.0.8",
28+
"vitepress-plugin-og": "^0.0.3",
2829
"vue-tsc": "^2.1.6"
2930
},
3031
"packageManager": "[email protected]"

0 commit comments

Comments
 (0)