nuxt-og-image 2.0.0-beta.14 → 2.0.0-beta.17
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/dist/module.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { useServerHead } from "@vueuse/head";
|
|
2
1
|
import { withBase } from "ufo";
|
|
3
2
|
import { useRequestEvent } from "#app";
|
|
4
3
|
import { useHostname } from "../nitro/util-hostname.mjs";
|
|
5
|
-
import { useRouter, useRuntimeConfig } from "#imports";
|
|
4
|
+
import { useRouter, useRuntimeConfig, useServerHead } from "#imports";
|
|
6
5
|
export function defineOgImageScreenshot(options = {}) {
|
|
7
6
|
const router = useRouter();
|
|
8
7
|
const route = router?.currentRoute?.value?.path || "";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import type { NitroAppPlugin } from 'nitropack';
|
|
2
|
+
declare const OgImagePrenderNitroPlugin: NitroAppPlugin;
|
|
3
|
+
export default OgImagePrenderNitroPlugin;
|
|
@@ -2,7 +2,7 @@ import { appendHeader } from "h3";
|
|
|
2
2
|
import { joinURL } from "ufo";
|
|
3
3
|
import { extractOgImageOptions } from "../utils-pure.mjs";
|
|
4
4
|
import { useRuntimeConfig } from "#imports";
|
|
5
|
-
|
|
5
|
+
const OgImagePrenderNitroPlugin = (nitroApp) => {
|
|
6
6
|
if (!process.env.prerender)
|
|
7
7
|
return;
|
|
8
8
|
const { forcePrerender } = useRuntimeConfig()["nuxt-og-image"];
|
|
@@ -16,4 +16,5 @@ export default defineNitroPlugin((nitroApp) => {
|
|
|
16
16
|
if ((forcePrerender || options.static) && options.provider === "satori")
|
|
17
17
|
appendHeader(event, "x-nitro-prerender", joinURL(url, "/__og_image__/og.png"));
|
|
18
18
|
});
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
|
+
export default OgImagePrenderNitroPlugin;
|