nuxt-og-image 3.0.0-rc.6 → 3.0.0-rc.7
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/client/200.html +4 -4
- package/dist/client/404.html +4 -4
- package/dist/client/_nuxt/{IconCSS.220290da.js → IconCSS.0eb8cd4b.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/17a46b2c-8a3e-4291-8b7c-d7877f1c67c4.json +1 -0
- package/dist/client/_nuxt/{entry.5d0abb3d.js → entry.5e4ce219.js} +3 -3
- package/dist/client/_nuxt/{error-404.e6048d23.js → error-404.69185016.js} +1 -1
- package/dist/client/_nuxt/{error-500.3bcefba1.js → error-500.0ed0878b.js} +1 -1
- package/dist/client/index.html +4 -4
- package/dist/module.json +1 -1
- package/dist/module.mjs +8 -3
- package/dist/runtime/server/routes/__og-image__/font-[name]-[weight].[extension].mjs +5 -5
- package/package.json +1 -1
- package/dist/client/_nuxt/builds/meta/e73d18b8-bd07-4a22-971c-e8ba17519e8f.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as a,u as n,o as r,c as l,a as e,t as s,b as d,w as c,d as p,e as f,p as x,f as h}from"./entry.
|
|
1
|
+
import{_ as a,u as n,o as r,c as l,a as e,t as s,b as d,w as c,d as p,e as f,p as x,f as h}from"./entry.5e4ce219.js";const m=t=>(x("data-v-05a2b8a3"),t=t(),h(),t),u={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},g=m(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),b={class:"max-w-520px text-center z-20"},_=["textContent"],w=["textContent"],y={class:"w-full flex items-center justify-center"},S={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const o=t;return n({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}a{color:inherit;text-decoration:inherit}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(k,v)=>{const i=f;return r(),l("div",u,[g,e("div",b,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,_),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,w),e("div",y,[d(i,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:c(()=>[p(s(t.backHome),1)]),_:1})])])])}}},z=a(S,[["__scopeId","data-v-05a2b8a3"]]);export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as i,u as a,o as r,c as n,a as e,t as s,p as l,f as d}from"./entry.
|
|
1
|
+
import{_ as i,u as a,o as r,c as n,a as e,t as s,p as l,f as d}from"./entry.5e4ce219.js";const c=t=>(l("data-v-c967d9a9"),t=t(),d(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},h=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),f={class:"max-w-520px text-center"},g=["textContent"],m=["textContent"],x={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return a({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(u,b)=>(r(),n("div",p,[h,e("div",f,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,g),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,m)])]))}},w=i(x,[["__scopeId","data-v-c967d9a9"]]);export{w as default};
|
package/dist/client/index.html
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
5
|
<link rel="stylesheet" href="/__nuxt-og-image/_nuxt/entry.a30f63d0.css">
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.5e4ce219.js">
|
|
7
7
|
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/vanilla-picker-NKbIFE8h.23409a58.js">
|
|
8
8
|
<link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-404.b751fa02.css">
|
|
9
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-404.
|
|
9
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-404.69185016.js">
|
|
10
10
|
<link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.69009e70.css">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-500.
|
|
12
|
-
<script type="module" src="/__nuxt-og-image/_nuxt/entry.
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-500.0ed0878b.js">
|
|
12
|
+
<script type="module" src="/__nuxt-og-image/_nuxt/entry.5e4ce219.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window&&window.localStorage&&window.localStorage.getItem&&window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?d():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:d,addColorScheme:i,removeColorScheme:f};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function f(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function d(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
|
|
13
13
|
</script></head>
|
|
14
14
|
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script>
|
|
15
15
|
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body>
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { createHash } from 'node:crypto';
|
|
|
14
14
|
import { execa } from 'execa';
|
|
15
15
|
import terminate from 'terminate';
|
|
16
16
|
|
|
17
|
-
const version = "3.0.0-rc.
|
|
17
|
+
const version = "3.0.0-rc.7";
|
|
18
18
|
|
|
19
19
|
const autodetectableProviders = {
|
|
20
20
|
azure_static: "azure",
|
|
@@ -298,6 +298,8 @@ function setupGenerateHandler(options, resolve, nuxt = useNuxt()) {
|
|
|
298
298
|
function setupPrerenderHandler(options, resolve, nuxt = useNuxt()) {
|
|
299
299
|
nuxt.hooks.hook("nitro:init", async (nitro) => {
|
|
300
300
|
nitro.hooks.hook("prerender:config", async (nitroConfig) => {
|
|
301
|
+
nitroConfig.serverAssets = nitroConfig.serverAssets || [];
|
|
302
|
+
nitroConfig.serverAssets.push({ baseName: "nuxt-og-image:fonts", dir: resolve("./runtime/server/assets") });
|
|
301
303
|
applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility.prerender, resolve });
|
|
302
304
|
nitroConfig.wasm = nitroConfig.wasm || {};
|
|
303
305
|
nitroConfig.wasm.esmImport = false;
|
|
@@ -657,8 +659,11 @@ ${componentImports}
|
|
|
657
659
|
nuxt.options.nitro = nuxt.options.nitro || {};
|
|
658
660
|
nuxt.options.nitro.prerender = nuxt.options.nitro.prerender || {};
|
|
659
661
|
nuxt.options.nitro.prerender.routes = nuxt.options.nitro.prerender.routes || [];
|
|
660
|
-
normalisedFonts.filter((f) => !f.path && !f.key).forEach((
|
|
661
|
-
|
|
662
|
+
normalisedFonts.filter((f) => !f.path && !f.key).forEach((entry, key) => {
|
|
663
|
+
const { name, weight } = entry;
|
|
664
|
+
entry.path = `/__og-image__/font/${name.toLowerCase()}/${weight}.ttf`;
|
|
665
|
+
nuxt.options.nitro.prerender.routes.push(entry.path);
|
|
666
|
+
normalisedFonts[key] = entry;
|
|
662
667
|
});
|
|
663
668
|
}
|
|
664
669
|
const hasColorModeModule = hasNuxtModule("@nuxtjs/color-mode");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createError, defineEventHandler } from "h3";
|
|
1
|
+
import { createError, defineEventHandler, proxyRequest, sendRedirect } from "h3";
|
|
2
2
|
import { parseURL } from "ufo";
|
|
3
3
|
export default defineEventHandler(async (e) => {
|
|
4
4
|
const path = parseURL(e.path).pathname;
|
|
@@ -20,11 +20,11 @@ export default defineEventHandler(async (e) => {
|
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
22
|
const ttfResource = css.match(/src: url\((.+)\) format\('(opentype|truetype)'\)/);
|
|
23
|
-
if (ttfResource[1])
|
|
24
|
-
return
|
|
23
|
+
if (ttfResource?.[1])
|
|
24
|
+
return proxyRequest(e, ttfResource[1], {});
|
|
25
25
|
const woff2Resource = css.match(/src: url\((.+)\) format\('woff2'\)/);
|
|
26
|
-
if (woff2Resource[1])
|
|
27
|
-
return
|
|
26
|
+
if (woff2Resource?.[1])
|
|
27
|
+
return sendRedirect(e, woff2Resource[1]);
|
|
28
28
|
return createError({
|
|
29
29
|
statusCode: 500,
|
|
30
30
|
statusMessage: `[Nuxt OG Image] Malformed Google Font CSS ${css}`
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"e73d18b8-bd07-4a22-971c-e8ba17519e8f","timestamp":1702284991975,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|