Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview meta #1821

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/assets/og-preview-image.webp
Binary file not shown.
21 changes: 20 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,25 @@ const previewAnalyticsTag = {
},
}

const previewMetaTag = [
{
injectTo: 'head' as const,
tag: 'meta',
attrs: {
property: 'og:image',
content: '/assets/og-preview-image.webp',
},
},
{
injectTo: 'head' as const,
tag: 'meta',
attrs: {
property: 'og:description',
content: 'Preview of the Oxide web console with in-browser mock API',
},
},
]

// see https://vitejs.dev/config/
export default defineConfig(({ mode }) => ({
build: {
Expand All @@ -85,7 +104,7 @@ export default defineConfig(({ mode }) => ({
plugins: [
createHtmlPlugin({
inject: {
tags: process.env.VERCEL ? [previewAnalyticsTag] : [],
tags: process.env.VERCEL ? [previewAnalyticsTag, ...previewMetaTag] : [],
},
}),
react(),
Expand Down
Loading