Skip to content

Commit 77822eb

Browse files
committed
fix: og image
1 parent bad6c9c commit 77822eb

File tree

8 files changed

+108
-392
lines changed

8 files changed

+108
-392
lines changed

.github/copilot-instructions.md

Lines changed: 0 additions & 76 deletions
This file was deleted.

app/components/AppLogo.vue

Lines changed: 21 additions & 46 deletions
Large diffs are not rendered by default.

app/components/OgImage/Article.vue

Lines changed: 0 additions & 156 deletions
This file was deleted.

app/components/OgImage/Page.vue

Lines changed: 5 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
:style="{ lineClamp: description ? 2 : 3 }"
2020
style="display: block; text-overflow: ellipsis"
2121
>
22-
{{ title }}
22+
{{ title || 'BibleTime' }}
2323
</h1>
2424
<p
2525
v-if="description"
@@ -30,30 +30,9 @@
3030
{{ description }}
3131
</p>
3232
</div>
33-
<div v-if="Boolean(icon)" style="width: 30%" class="flex justify-end">
34-
<IconComponent :name="icon" size="250px" style="margin: 0 auto; opacity: 0.7" />
35-
</div>
3633
</div>
3734
<div class="flex flex-row justify-center items-center text-left w-full">
38-
<AppLogo v-if="siteLogo" />
39-
<template v-else>
40-
<svg
41-
width="50"
42-
height="50"
43-
class="mr-3"
44-
viewBox="0 0 200 200"
45-
xmlns="http://www.w3.org/2000/svg"
46-
>
47-
<path
48-
transform="translate(100 100)"
49-
:fill="theme.includes('#') ? theme : `#${theme}`"
50-
d="M62.3,-53.9C74.4,-34.5,73.5,-9,67.1,13.8C60.6,36.5,48.7,56.5,30.7,66.1C12.7,75.7,-11.4,74.8,-31.6,65.2C-51.8,55.7,-67.9,37.4,-73.8,15.7C-79.6,-6,-75.1,-31.2,-61.1,-51C-47.1,-70.9,-23.6,-85.4,0.8,-86C25.1,-86.7,50.2,-73.4,62.3,-53.9Z"
51-
/>
52-
</svg>
53-
<p v-if="siteName" class="font-bold" style="font-size: 25px">
54-
{{ siteName }}
55-
</p>
56-
</template>
35+
<AppLogo style="height: 120px; width: 484px" />
5736
</div>
5837
</div>
5938
</div>
@@ -64,26 +43,21 @@
6443
*/
6544
6645
import { useOgImageRuntimeConfig } from '#og-image/app/utils'
67-
import { useSiteConfig } from '#site-config/app/composables'
68-
import { computed, defineComponent, h, resolveComponent } from 'vue'
46+
import { computed } from 'vue'
6947
7048
// convert to typescript props
7149
const props = withDefaults(
7250
defineProps<{
51+
avatar?: string
7352
colorMode?: 'dark' | 'light'
7453
description?: string
75-
icon?: boolean | string
76-
siteLogo?: string
77-
siteName?: string
7854
theme?: string
7955
title?: string
8056
}>(),
8157
{
58+
avatar: 'https://wol.jw.org/en/wol/mp/r1/lp-e/w13/2013/1210',
8259
colorMode: undefined,
8360
description: undefined,
84-
icon: undefined,
85-
siteLogo: undefined,
86-
siteName: undefined,
8761
theme: '#0f356e',
8862
title: 'title'
8963
}
@@ -131,26 +105,4 @@ const themeRgb = computed(() => {
131105
?.map((v) => Number.parseInt(v, 16))
132106
.join(', ')
133107
})
134-
135-
const siteConfig = useSiteConfig()
136-
const siteName = computed(() => {
137-
return props.siteName || siteConfig.name
138-
})
139-
const siteLogo = computed(() => {
140-
return props.siteLogo || siteConfig.logo
141-
})
142-
143-
const IconComponent = runtimeConfig.hasNuxtIcon
144-
? resolveComponent('Icon')
145-
: defineComponent({
146-
render() {
147-
return h('div', 'missing @nuxt/icon')
148-
}
149-
})
150-
if (typeof props.icon === 'string' && !runtimeConfig.hasNuxtIcon && import.meta.dev) {
151-
console.warn('Please install `@nuxt/icon` to use icons with the fallback OG Image component.')
152-
153-
console.log('\nnpx nuxi module add icon\n')
154-
// create simple div renderer component
155-
}
156108
</script>

app/error.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ useHead({
2828
})
2929
3030
useSeoMeta({
31-
description: props.error.statusMessage,
31+
description: props.error.statusMessage || props.error.message,
3232
title: props.error.statusCode
3333
})
34+
35+
defineOgImageComponent('Page', {
36+
description: props.error.statusMessage || props.error.message,
37+
title: props.error.statusCode.toString()
38+
})
3439
</script>

app/pages/og.vue

Lines changed: 0 additions & 8 deletions
This file was deleted.

nuxt.config.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { iconBaseUrl, maskableSizes, transparentSizes } from './app/utils/assets
1111
export default defineNuxtConfig({
1212
alias: { '#server': fileURLToPath(new URL('./server', import.meta.url)) },
1313

14+
colorMode: { fallback: 'light', preference: 'system' },
15+
1416
compatibilityDate: '2024-07-11',
1517

1618
css: ['~/assets/css/main.css'],
@@ -44,8 +46,6 @@ export default defineNuxtConfig({
4446
'pinia-plugin-persistedstate/nuxt'
4547
],
4648

47-
// image: { alias: { wol: 'https://wol.jw.org' }, domains: ['wol.jw.org'] },
48-
4949
netlify: { headers: { enabled: true }, redirects: { enabled: true } },
5050

5151
pwa: {
@@ -90,12 +90,6 @@ export default defineNuxtConfig({
9090

9191
seo: { fallbackTitle: false },
9292

93-
site: {
94-
logo: '/brand/logo-horizontal.svg',
95-
name: process.env.NUXT_SITE_NAME || 'BibleTime',
96-
url: process.env.NUXT_SITE_URL || 'http://localhost:3000'
97-
},
98-
9993
sitemap: {
10094
sources: ['/api/__sitemap__/urls?type=events', '/api/__sitemap__/urls?type=people']
10195
// sitemaps: {

0 commit comments

Comments
 (0)