Skip to content

Commit

Permalink
feat: use new og-image zero-runtime feature (#1444)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Sep 12, 2024
1 parent d59037a commit 19b9f3a
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 234 deletions.
6 changes: 3 additions & 3 deletions app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defineOgImageComponent('DefaultImage', {
})
if (import.meta.server) {
prerenderRoutes(joinURL('/__og-image__/image', route.path, 'og.png'))
prerenderRoutes(joinURL('/__og-image__/static', route.path, 'og.png'))
}
// TODO: interactive components within server components
Expand Down Expand Up @@ -61,11 +61,11 @@ if (import.meta.server) {
{ property: 'og:url', content: url },
{
property: 'og:image',
content: `https://roe.dev/og/og.jpg`,
content: `https://roe.dev/__og-image__/static/og.png`,
key: 'og:image',
},
{ property: 'og:image:width', content: '1200' },
{ property: 'og:image:height', content: '630' },
{ property: 'og:image:height', content: '600' },
{
property: 'og:title',
content: (route.meta.title as string) || 'Daniel Roe',
Expand Down
44 changes: 0 additions & 44 deletions modules/og-tweaks.ts

This file was deleted.

11 changes: 1 addition & 10 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,16 +226,7 @@ export default defineNuxtConfig({
},

ogImage: {
compatibility: {
runtime: {
'css-inline': false,
'chromium': false,
'resvg': false,
'satori': false,
'sharp': false,
},
prerender: {},
},
zeroRuntime: true,
fonts: [
'Barlow:400',
'Barlow:600',
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@iconify-json/svg-spinners": "^1.2.0",
"@iconify-json/tabler": "^1.2.0",
"@nuxt/content": "2.13.2",
"@nuxt/eslint": "0.5.5",
"@nuxt/eslint": "0.5.7",
"@nuxt/fonts": "0.7.2",
"@nuxt/image": "1.8.0",
"@nuxtjs/color-mode": "3.4.4",
Expand All @@ -52,7 +52,7 @@
"masto": "^6.8.0",
"mlly": "^1.7.1",
"nuxt": "^3.13.1",
"nuxt-og-image": "3.0.0-rc.66",
"nuxt-og-image": "3.0.1",
"nuxt-security": "2.0.0-rc.9",
"nuxt-time": "^0.1.3",
"partykit": "0.0.110",
Expand All @@ -73,7 +73,7 @@
"devDependencies": {
"@commitlint/cli": "19.4.1",
"@commitlint/config-conventional": "19.4.1",
"@nuxt/test-utils": "3.14.1",
"@nuxt/test-utils": "3.14.2",
"@playwright/test": "1.46.1",
"@vue/test-utils": "2.4.6",
"eslint": "9.9.1",
Expand Down
Loading

0 comments on commit 19b9f3a

Please sign in to comment.