Skip to content

Commit 4e1bbe1

Browse files
Preview meta (#1821)
* Preview OG meta * Tweak text spacing * shorten description --------- Co-authored-by: David Crespo <david.crespo@oxidecomputer.com>
1 parent 17408f6 commit 4e1bbe1

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
87.8 KB
Loading

vite.config.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,25 @@ const previewAnalyticsTag = {
6060
},
6161
}
6262

63+
const previewMetaTag = [
64+
{
65+
injectTo: 'head' as const,
66+
tag: 'meta',
67+
attrs: {
68+
property: 'og:image',
69+
content: '/assets/og-preview-image.webp',
70+
},
71+
},
72+
{
73+
injectTo: 'head' as const,
74+
tag: 'meta',
75+
attrs: {
76+
property: 'og:description',
77+
content: 'Preview of the Oxide web console with in-browser mock API',
78+
},
79+
},
80+
]
81+
6382
// see https://vitejs.dev/config/
6483
export default defineConfig(({ mode }) => ({
6584
build: {
@@ -85,7 +104,7 @@ export default defineConfig(({ mode }) => ({
85104
plugins: [
86105
createHtmlPlugin({
87106
inject: {
88-
tags: process.env.VERCEL ? [previewAnalyticsTag] : [],
107+
tags: process.env.VERCEL ? [previewAnalyticsTag, ...previewMetaTag] : [],
89108
},
90109
}),
91110
react(),

0 commit comments

Comments
 (0)