nuxt-og-image 3.0.0-beta.9 → 3.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/client/200.html +6 -5
- package/dist/client/404.html +6 -5
- package/dist/client/_nuxt/IconCSS.bca1abaf.js +1 -0
- package/dist/client/_nuxt/IconCSS.f0b56d3e.css +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c430c582-423d-48d2-8592-39b7bfd61658.json +1 -0
- package/dist/client/_nuxt/entry.a30f63d0.css +1 -0
- package/dist/client/_nuxt/entry.f2e056ce.js +108 -0
- package/dist/client/_nuxt/{error-404.18456c20.js → error-404.1b7ec865.js} +1 -1
- package/dist/client/_nuxt/{error-500.a3e12514.js → error-500.1f097e6f.js} +1 -1
- package/dist/client/_nuxt/vanilla-picker-NKbIFE8h.23409a58.js +8 -0
- package/dist/client/index.html +6 -5
- package/dist/module.d.mts +63 -48
- package/dist/module.d.ts +63 -48
- package/dist/module.json +2 -2
- package/dist/module.mjs +346 -166
- package/dist/runtime/cache.d.ts +7 -10
- package/dist/runtime/cache.mjs +40 -27
- package/dist/runtime/components/OgImage/OgImage.d.ts +5 -0
- package/dist/runtime/components/OgImage/{index.mjs → OgImage.mjs} +1 -1
- package/dist/runtime/components/OgImage/OgImageScreenshot.d.ts +5 -0
- package/dist/runtime/components/OgImage/{Screenshot.mjs → OgImageScreenshot.mjs} +1 -1
- package/dist/runtime/components/Templates/{Official → Community}/BrandedLogo.vue +3 -2
- package/dist/runtime/components/Templates/Community/Nuxt.vue +6 -5
- package/dist/runtime/components/Templates/Community/NuxtSeo.vue +137 -0
- package/dist/runtime/components/Templates/Community/Pergel.vue +104 -0
- package/dist/runtime/components/Templates/{Official → Community}/SimpleBlog.vue +7 -5
- package/dist/runtime/components/Templates/Community/UnJs.vue +108 -0
- package/dist/runtime/components/Templates/{Official → Community}/Wave.vue +3 -2
- package/dist/runtime/components/Templates/{Official → Community}/WithEmoji.vue +3 -2
- package/dist/runtime/composables/defineOgImage.d.ts +2 -23
- package/dist/runtime/composables/defineOgImage.mjs +33 -117
- package/dist/runtime/composables/defineOgImageComponent.d.ts +3 -0
- package/dist/runtime/composables/defineOgImageComponent.mjs +8 -0
- package/dist/runtime/composables/defineOgImageScreenshot.d.ts +2 -0
- package/dist/runtime/composables/defineOgImageScreenshot.mjs +13 -0
- package/dist/runtime/core/bindings/css-inline/node.d.ts +2 -5
- package/dist/runtime/core/bindings/css-inline/node.mjs +2 -10
- package/dist/runtime/core/bindings/resvg/wasm-fs.d.ts +40 -0
- package/dist/runtime/core/bindings/resvg/wasm-fs.mjs +6 -0
- package/dist/runtime/core/bindings/resvg/wasm.mjs +2 -5
- package/dist/runtime/core/bindings/satori/wasm-fs.mjs +13 -0
- package/dist/runtime/core/bindings/satori/wasm.d.ts +6 -0
- package/dist/runtime/core/bindings/satori/wasm.mjs +14 -0
- package/dist/runtime/core/cache/emojis.d.ts +1 -0
- package/dist/runtime/core/cache/emojis.mjs +5 -0
- package/dist/runtime/core/cache/fonts.d.ts +3 -0
- package/dist/runtime/core/cache/fonts.mjs +6 -0
- package/dist/runtime/core/cache/htmlPayload.d.ts +5 -0
- package/dist/runtime/core/cache/htmlPayload.mjs +6 -0
- package/dist/runtime/core/cache/prerender.d.ts +1 -5
- package/dist/runtime/core/cache/prerender.mjs +1 -2
- package/dist/runtime/core/env/assets.d.ts +0 -1
- package/dist/runtime/core/env/assets.mjs +0 -4
- package/dist/runtime/core/font/fetch.d.ts +2 -3
- package/dist/runtime/core/font/fetch.mjs +26 -19
- package/dist/runtime/core/html/applyEmojis.d.ts +3 -0
- package/dist/runtime/core/html/applyEmojis.mjs +37 -0
- package/dist/runtime/core/html/applyInlineCss.d.ts +3 -0
- package/dist/runtime/core/html/applyInlineCss.mjs +32 -0
- package/dist/runtime/core/html/devIframeTemplate.d.ts +2 -0
- package/dist/runtime/core/html/{fetch.mjs → devIframeTemplate.mjs} +33 -42
- package/dist/runtime/core/html/fetchIsland.d.ts +3 -0
- package/dist/runtime/core/html/fetchIsland.mjs +17 -0
- package/dist/runtime/core/options/fetch.d.ts +1 -1
- package/dist/runtime/core/options/fetch.mjs +10 -5
- package/dist/runtime/core/renderers/chromium/index.mjs +12 -15
- package/dist/runtime/core/renderers/chromium/screenshot.d.ts +2 -3
- package/dist/runtime/core/renderers/chromium/screenshot.mjs +20 -15
- package/dist/runtime/core/renderers/satori/index.d.ts +2 -3
- package/dist/runtime/core/renderers/satori/index.mjs +51 -25
- package/dist/runtime/core/renderers/satori/instances.d.ts +3 -0
- package/dist/runtime/core/renderers/satori/instances.mjs +15 -0
- package/dist/runtime/core/renderers/satori/plugins/emojis.mjs +15 -13
- package/dist/runtime/core/renderers/satori/plugins/imageSrc.mjs +60 -30
- package/dist/runtime/core/renderers/satori/plugins/unocss.d.ts +2 -0
- package/dist/runtime/core/renderers/satori/plugins/unocss.mjs +45 -0
- package/dist/runtime/core/renderers/satori/utils.d.ts +2 -3
- package/dist/runtime/core/renderers/satori/vnodes.d.ts +2 -3
- package/dist/runtime/core/renderers/satori/vnodes.mjs +16 -6
- package/dist/runtime/core/utils/resolveRendererContext.d.ts +2 -6
- package/dist/runtime/core/utils/resolveRendererContext.mjs +47 -29
- package/dist/runtime/core/utils/wasm.d.ts +3 -0
- package/dist/runtime/core/utils/wasm.mjs +16 -0
- package/dist/runtime/nitro/plugins/nuxt-content.mjs +7 -6
- package/dist/runtime/nitro/plugins/prerender.d.ts +1 -1
- package/dist/runtime/nitro/plugins/prerender.mjs +20 -18
- package/dist/runtime/nitro/utils.d.ts +2 -0
- package/dist/runtime/nitro/utils.mjs +17 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.mjs +43 -0
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.mjs +16 -51
- package/dist/runtime/nuxt/utils.d.ts +3 -0
- package/dist/runtime/nuxt/utils.mjs +69 -0
- package/dist/runtime/server/routes/__og-image__/debug.json.d.ts +2 -3
- package/dist/runtime/server/routes/__og-image__/debug.json.mjs +5 -7
- package/dist/runtime/server/routes/__og-image__/image.mjs +88 -0
- package/dist/runtime/types.d.ts +96 -27
- package/dist/runtime/utils.d.ts +4 -0
- package/dist/runtime/utils.mjs +11 -0
- package/dist/runtime/utils.pure.d.ts +6 -0
- package/dist/runtime/utils.pure.mjs +63 -0
- package/package.json +33 -38
- package/virtual.d.ts +49 -0
- package/dist/client/_nuxt/IconCSS.05a4ab6a.js +0 -1
- package/dist/client/_nuxt/IconCSS.8f429b14.css +0 -1
- package/dist/client/_nuxt/builds/meta/ce33a6eb-5cc2-4c46-8618-9befaa3f226c.json +0 -1
- package/dist/client/_nuxt/entry.434c2c45.css +0 -1
- package/dist/client/_nuxt/entry.d927023c.js +0 -137
- package/dist/client/grid.png +0 -0
- package/dist/runtime/components/OgImage/Cached.d.ts +0 -5
- package/dist/runtime/components/OgImage/Cached.mjs +0 -10
- package/dist/runtime/components/OgImage/Dynamic.d.ts +0 -8
- package/dist/runtime/components/OgImage/Dynamic.mjs +0 -10
- package/dist/runtime/components/OgImage/Screenshot.d.ts +0 -6
- package/dist/runtime/components/OgImage/Static.d.ts +0 -8
- package/dist/runtime/components/OgImage/Static.mjs +0 -10
- package/dist/runtime/components/OgImage/WithoutCache.d.ts +0 -5
- package/dist/runtime/components/OgImage/WithoutCache.mjs +0 -10
- package/dist/runtime/components/OgImage/index.d.ts +0 -5
- package/dist/runtime/components/Templates/Official/Fallback.vue +0 -147
- package/dist/runtime/core/bindings/css-inline/mock.d.ts +0 -5
- package/dist/runtime/core/bindings/css-inline/mock.mjs +0 -3
- package/dist/runtime/core/bindings/satori/yoga-wasm.mjs +0 -7
- package/dist/runtime/core/bindings/sharp/wasm.d.ts +0 -2
- package/dist/runtime/core/bindings/sharp/wasm.mjs +0 -2
- package/dist/runtime/core/font/cache.d.ts +0 -1
- package/dist/runtime/core/font/cache.mjs +0 -1
- package/dist/runtime/core/html/fetch.d.ts +0 -3
- package/dist/runtime/core/options/normalise.d.ts +0 -2
- package/dist/runtime/core/options/normalise.mjs +0 -26
- package/dist/runtime/core/renderers/satori/fonts.d.ts +0 -3
- package/dist/runtime/core/renderers/satori/fonts.mjs +0 -8
- package/dist/runtime/nuxt/plugins/nuxt-content-canonical-urls.mjs +0 -29
- package/dist/runtime/public-assets/__nuxt_og_image__/browser-provider-not-supported.png +0 -0
- package/dist/runtime/server/routes/__og-image__/image-[path]-og.[extension].mjs +0 -45
- package/dist/runtime/utilts.d.ts +0 -2
- package/dist/runtime/utilts.mjs +0 -8
- /package/dist/runtime/core/bindings/satori/{yoga-wasm.d.ts → wasm-fs.d.ts} +0 -0
- /package/dist/runtime/nuxt/plugins/{nuxt-content-canonical-urls.d.ts → og-image-canonical-urls.server.d.ts} +0 -0
- /package/dist/runtime/{public-assets-optional/inter-font → server/assets}/inter-latin-ext-400-normal.woff +0 -0
- /package/dist/runtime/{public-assets-optional/inter-font → server/assets}/inter-latin-ext-700-normal.woff +0 -0
- /package/dist/runtime/server/routes/__og-image__/{image-[path]-og.[extension].d.ts → image.d.ts} +0 -0
package/dist/client/grid.png
DELETED
|
Binary file
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
import { defineOgImageCached } from "#imports";
|
|
3
|
-
export default defineComponent({
|
|
4
|
-
name: "OgImageCached",
|
|
5
|
-
async setup(_, { attrs }) {
|
|
6
|
-
if (import.meta.server)
|
|
7
|
-
await defineOgImageCached(attrs);
|
|
8
|
-
return () => null;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Use OgImageWithoutCache
|
|
4
|
-
*/
|
|
5
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
}, {}>;
|
|
8
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
import { defineOgImageWithoutCache } from "#imports";
|
|
3
|
-
export default defineComponent({
|
|
4
|
-
name: "OgImageDynamic",
|
|
5
|
-
async setup(_, { attrs }) {
|
|
6
|
-
if (import.meta.server)
|
|
7
|
-
await defineOgImageWithoutCache(attrs);
|
|
8
|
-
return () => null;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { OgImageScreenshotOptions } from '../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageScreenshotOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageScreenshotOptions>>, {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
[x: number]: any;
|
|
5
|
-
}, {}>;
|
|
6
|
-
export default _default;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Use OgImageCached instead
|
|
4
|
-
*/
|
|
5
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
}, {}>;
|
|
8
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
import { defineOgImageCached } from "#imports";
|
|
3
|
-
export default defineComponent({
|
|
4
|
-
name: "OgImageStatic",
|
|
5
|
-
async setup(_, { attrs }) {
|
|
6
|
-
if (import.meta.server)
|
|
7
|
-
await defineOgImageCached(attrs);
|
|
8
|
-
return () => null;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
import { defineOgImageWithoutCache } from "#imports";
|
|
3
|
-
export default defineComponent({
|
|
4
|
-
name: "OgImageWithoutCache",
|
|
5
|
-
async setup(_, { attrs }) {
|
|
6
|
-
if (import.meta.server)
|
|
7
|
-
defineOgImageWithoutCache(attrs);
|
|
8
|
-
return () => null;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export default _default;
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, defineComponent, h, resolveComponent } from 'vue'
|
|
3
|
-
import { useRuntimeConfig, useSiteConfig } from '#imports'
|
|
4
|
-
|
|
5
|
-
// inherited attrs can mess up the satori parser
|
|
6
|
-
defineOptions({
|
|
7
|
-
inheritAttrs: false,
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
// convert to typescript props
|
|
11
|
-
const props = withDefaults(defineProps<{
|
|
12
|
-
colorMode?: 'dark' | 'light'
|
|
13
|
-
title?: string
|
|
14
|
-
description?: string
|
|
15
|
-
icon?: string | boolean
|
|
16
|
-
siteName?: string
|
|
17
|
-
siteLogo?: string
|
|
18
|
-
theme?: string
|
|
19
|
-
}>(), {
|
|
20
|
-
theme: '#00dc82',
|
|
21
|
-
colorMode: 'dark',
|
|
22
|
-
title: 'title',
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const backgroundAttrs = computed(() => {
|
|
26
|
-
// we want to make a
|
|
27
|
-
// const isBackgroundTw = props.background?.startsWith('bg-')
|
|
28
|
-
return {
|
|
29
|
-
style: {
|
|
30
|
-
display: 'flex',
|
|
31
|
-
position: 'absolute',
|
|
32
|
-
width: '100%',
|
|
33
|
-
height: '100%',
|
|
34
|
-
background: props.colorMode === 'dark' ? 'rgba(5, 5, 5,1)' : 'rgb(255, 255, 255)',
|
|
35
|
-
},
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
const backgroundFlareAttrs = computed(() => {
|
|
40
|
-
// we want to make a
|
|
41
|
-
// const isBackgroundTw = props.background?.startsWith('bg-')
|
|
42
|
-
// need to convert hex to RGB, i.e #123123 -> 18, 49, 35
|
|
43
|
-
const rgbColor = props.theme
|
|
44
|
-
.replace('#', '')
|
|
45
|
-
.match(/.{1,2}/g)
|
|
46
|
-
?.map(v => Number.parseInt(v, 16))
|
|
47
|
-
.join(', ')
|
|
48
|
-
return {
|
|
49
|
-
style: {
|
|
50
|
-
display: 'flex',
|
|
51
|
-
position: 'absolute',
|
|
52
|
-
right: '-100%',
|
|
53
|
-
top: '0%',
|
|
54
|
-
width: '200%',
|
|
55
|
-
height: '200%',
|
|
56
|
-
backgroundImage: `radial-gradient(circle, rgba(${rgbColor}, 0.5) 0%, ${props.colorMode === 'dark' ? 'rgba(5, 5, 5,0.3)' : 'rgba(255, 255, 255, 0.7)'} 50%, ${props.colorMode === 'dark' ? 'rgba(5, 5, 5,0)' : 'rgba(255, 255, 255, 0)'} 70%)`,
|
|
57
|
-
},
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
const containerAttrs = computed(() => {
|
|
62
|
-
const classes = [
|
|
63
|
-
'w-full',
|
|
64
|
-
'h-full',
|
|
65
|
-
'flex',
|
|
66
|
-
'justify-between',
|
|
67
|
-
props.colorMode === 'dark' ? 'text-gray-100' : 'text-gray-900',
|
|
68
|
-
'relative',
|
|
69
|
-
]
|
|
70
|
-
const styles: Record<string, any> = {
|
|
71
|
-
padding: '5rem',
|
|
72
|
-
}
|
|
73
|
-
return { class: classes, style: styles }
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
const titleAttrs = computed(() => {
|
|
77
|
-
return { style: {
|
|
78
|
-
fontWeight: 'bold',
|
|
79
|
-
marginBottom: '50px',
|
|
80
|
-
fontSize: '75px',
|
|
81
|
-
maxWidth: !props.icon ? '70%' : undefined,
|
|
82
|
-
} }
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
const descriptionAttrs = computed(() => {
|
|
86
|
-
return { style: {
|
|
87
|
-
fontSize: '35px',
|
|
88
|
-
lineHeight: `1.5rem`,
|
|
89
|
-
opacity: '0.8',
|
|
90
|
-
} }
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
const siteConfig = useSiteConfig()
|
|
94
|
-
const siteName = computed(() => {
|
|
95
|
-
return props.siteName || siteConfig.name
|
|
96
|
-
})
|
|
97
|
-
const siteLogo = computed(() => {
|
|
98
|
-
return props.siteLogo || siteConfig.logo
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
const runtimeConfig = useRuntimeConfig()['nuxt-og-image']
|
|
102
|
-
|
|
103
|
-
const IconComponent = runtimeConfig.hasNuxtIcon
|
|
104
|
-
? resolveComponent('Icon')
|
|
105
|
-
: defineComponent({
|
|
106
|
-
render() {
|
|
107
|
-
return h('div', 'missing nuxt-icon')
|
|
108
|
-
},
|
|
109
|
-
})
|
|
110
|
-
if (typeof props.icon === 'string' && !runtimeConfig.hasNuxtIcon && process.dev) {
|
|
111
|
-
console.warn('Please install `nuxt-icon` to use icons with the fallback OG Image component.')
|
|
112
|
-
// eslint-disable-next-line no-console
|
|
113
|
-
console.log('\nnpm add -D nuxt-icon\n')
|
|
114
|
-
// create simple div renderer component
|
|
115
|
-
}
|
|
116
|
-
</script>
|
|
117
|
-
|
|
118
|
-
<template>
|
|
119
|
-
<div v-bind="backgroundAttrs" />
|
|
120
|
-
<div v-bind="backgroundFlareAttrs" />
|
|
121
|
-
<div v-bind="containerAttrs">
|
|
122
|
-
<div class="flex flex-row justify-between items-center">
|
|
123
|
-
<div class="flex flex-col w-full" :style="icon ? { width: '65%' } : {}">
|
|
124
|
-
<div v-bind="titleAttrs">
|
|
125
|
-
{{ title || 'Null Title' }}
|
|
126
|
-
</div>
|
|
127
|
-
<div v-if="description" v-bind="descriptionAttrs">
|
|
128
|
-
{{ description }}
|
|
129
|
-
</div>
|
|
130
|
-
</div>
|
|
131
|
-
<div v-if="icon" style="width: 30%;" class="flex justify-end">
|
|
132
|
-
<IconComponent :name="icon" size="250px" style="margin: 0 auto 0 100px;opacity: 0.9;" />
|
|
133
|
-
</div>
|
|
134
|
-
</div>
|
|
135
|
-
<div class="flex flex-row justify-center items-center text-left w-full">
|
|
136
|
-
<img v-if="siteLogo" :src="siteLogo" height="30">
|
|
137
|
-
<template v-else>
|
|
138
|
-
<svg height="50" width="50" class="mr-3" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
|
|
139
|
-
<path :fill="theme.includes('#') ? theme : `#${theme}`" 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" transform="translate(100 100)" />
|
|
140
|
-
</svg>
|
|
141
|
-
<div v-if="siteName" style="font-size: 25px;" class="font-bold">
|
|
142
|
-
{{ siteName }}
|
|
143
|
-
</div>
|
|
144
|
-
</template>
|
|
145
|
-
</div>
|
|
146
|
-
</div>
|
|
147
|
-
</template>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const fontCache: Record<string, any>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const fontCache = {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { unref, useRuntimeConfig } from "#imports";
|
|
2
|
-
import { componentNames } from "#build/og-image-component-names.mjs";
|
|
3
|
-
export function normaliseOptions(_options) {
|
|
4
|
-
const { runtimeSatori } = useRuntimeConfig()["nuxt-og-image"];
|
|
5
|
-
const options = { ...unref(_options) };
|
|
6
|
-
if (options.static)
|
|
7
|
-
options.cache = options.cache || options.static;
|
|
8
|
-
if (options.provider === "satori")
|
|
9
|
-
options.renderer = options.renderer || "satori";
|
|
10
|
-
else if (options.provider === "browser")
|
|
11
|
-
options.renderer = options.renderer || "chromium";
|
|
12
|
-
options.renderer = options.renderer || "satori";
|
|
13
|
-
if (options.renderer === "satori" && !runtimeSatori)
|
|
14
|
-
options.renderer = "chromium";
|
|
15
|
-
if (options.component && componentNames) {
|
|
16
|
-
const originalName = options.component;
|
|
17
|
-
for (const component of componentNames) {
|
|
18
|
-
if (component.pascalName.endsWith(originalName) || component.kebabName.endsWith(originalName)) {
|
|
19
|
-
options.component = component.pascalName;
|
|
20
|
-
options.componentHash = component.hash;
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return options;
|
|
26
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { loadFont } from "../../font/fetch.mjs";
|
|
2
|
-
export const satoriFonts = [];
|
|
3
|
-
let fontLoadPromise = null;
|
|
4
|
-
export function loadFonts(baseURL, fonts) {
|
|
5
|
-
if (fontLoadPromise)
|
|
6
|
-
return fontLoadPromise;
|
|
7
|
-
return fontLoadPromise = Promise.all(fonts.map((font) => loadFont(baseURL, font)));
|
|
8
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { parseURL } from "ufo";
|
|
2
|
-
import { toValue } from "vue";
|
|
3
|
-
import { isInternalRoute } from "../../utilts.mjs";
|
|
4
|
-
import { useRequestEvent, withSiteUrl } from "#imports";
|
|
5
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
6
|
-
nuxtApp.hooks.hook("app:rendered", async (ctx) => {
|
|
7
|
-
const { ssrContext } = ctx;
|
|
8
|
-
const e = useRequestEvent();
|
|
9
|
-
const path = parseURL(e.path).pathname;
|
|
10
|
-
if (isInternalRoute(path))
|
|
11
|
-
return;
|
|
12
|
-
ssrContext?.head.use({
|
|
13
|
-
key: "nuxt-og-image:canonical-urls",
|
|
14
|
-
hooks: {
|
|
15
|
-
"tags:resolve": async ({ tags }) => {
|
|
16
|
-
for (const tag of tags) {
|
|
17
|
-
if (tag.tag === "meta" && (tag.props.property === "og:image" || tag.props.name === "twitter:image:src")) {
|
|
18
|
-
if (!tag.props.content.startsWith("https")) {
|
|
19
|
-
await nuxtApp.runWithContext(() => {
|
|
20
|
-
tag.props.content = toValue(withSiteUrl(tag.props.content));
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
});
|
|
Binary file
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { H3Error, createError, defineEventHandler, setHeader } from "h3";
|
|
2
|
-
import { resolveRendererContext } from "../../../core/utils/resolveRendererContext.mjs";
|
|
3
|
-
import { fetchHTML } from "../../../core/html/fetch.mjs";
|
|
4
|
-
import { useSiteConfig } from "#imports";
|
|
5
|
-
export default defineEventHandler(async (e) => {
|
|
6
|
-
const ctx = await resolveRendererContext(e);
|
|
7
|
-
if (ctx instanceof H3Error)
|
|
8
|
-
return ctx;
|
|
9
|
-
const { extension, options, renderer } = ctx;
|
|
10
|
-
if (!options.cacheTtl || import.meta.dev) {
|
|
11
|
-
setHeader(e, "Cache-Control", "no-cache, no-store, must-revalidate");
|
|
12
|
-
setHeader(e, "Pragma", "no-cache");
|
|
13
|
-
setHeader(e, "Expires", "0");
|
|
14
|
-
}
|
|
15
|
-
switch (extension) {
|
|
16
|
-
case "html":
|
|
17
|
-
setHeader(e, "Content-Type", `text/html`);
|
|
18
|
-
return fetchHTML(e, options);
|
|
19
|
-
case "json":
|
|
20
|
-
setHeader(e, "Content-Type", "application/json");
|
|
21
|
-
return {
|
|
22
|
-
...ctx,
|
|
23
|
-
siteConfig: useSiteConfig(e),
|
|
24
|
-
vnodes: options.renderer === "satori" ? await renderer.createImage(e, { ...options, extension: "json" }) : void 0
|
|
25
|
-
};
|
|
26
|
-
case "svg":
|
|
27
|
-
case "png":
|
|
28
|
-
case "jpeg":
|
|
29
|
-
case "jpg":
|
|
30
|
-
if (!renderer.supportedFormats.includes(options.extension)) {
|
|
31
|
-
return createError({
|
|
32
|
-
statusCode: 400,
|
|
33
|
-
statusMessage: `Generating ${options.extension}'s with ${renderer.name} is not supported.`
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
setHeader(e, "Content-Type", `image/${options.extension === "svg" ? "svg+xml" : options.extension}`);
|
|
37
|
-
break;
|
|
38
|
-
default:
|
|
39
|
-
return createError({
|
|
40
|
-
statusCode: 400,
|
|
41
|
-
statusMessage: `Invalid request for og.${options.extension}.`
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return renderer.createImage(e, options);
|
|
45
|
-
});
|
package/dist/runtime/utilts.d.ts
DELETED
package/dist/runtime/utilts.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { joinURL } from "ufo";
|
|
2
|
-
export function getOgImagePath(pagePath, extension = "png") {
|
|
3
|
-
return joinURL("/__og-image__/image", pagePath, `og.${extension}`);
|
|
4
|
-
}
|
|
5
|
-
export function isInternalRoute(path) {
|
|
6
|
-
const lastSegment = path.split("/").pop() || path;
|
|
7
|
-
return lastSegment.includes(".") || path.startsWith("/__") || path.startsWith("@");
|
|
8
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/runtime/server/routes/__og-image__/{image-[path]-og.[extension].d.ts → image.d.ts}
RENAMED
|
File without changes
|