Skip to content

Commit

Permalink
add opengraph and canonical
Browse files Browse the repository at this point in the history
  • Loading branch information
antonio-gg-dev committed Dec 20, 2023
1 parent e968ee6 commit 100e1df
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,33 @@ export default defineConfig({
'link',
{ rel: 'icon', href: '/favicon.ico' },
],
[
'meta',
{ property: 'og:type', content: 'website' },
],
[
'meta',
{ property: 'og:image', content: '/images/og-image.png' },
],
],
transformHead(context) {
const canonical = context.page.replace(/(index)?\.md$/, '')

return [
[
'meta',
{ property: 'og:title', content: context.title },
],
[
'meta',
{ property: 'og:url', content: `https://antonio.gg/${canonical}` },
],
[
'link',
{ rel: 'canonical', href: `https://antonio.gg/${canonical}` },
],
]
},

// Routing
cleanUrls: true,
Expand Down
Binary file added public/images/og-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 100e1df

Please sign in to comment.