diff --git a/app.config.ts b/app.config.ts index d40cc96..85b4662 100644 --- a/app.config.ts +++ b/app.config.ts @@ -93,6 +93,9 @@ export default defineConfig({ vite(options) { return { + // define: { + // "import.meta.env.BASE_URL": JSON.stringify("/foo"), + // }, css: { postcss: "./postcss.config.js" }, server: { port: 3000, diff --git a/package.json b/package.json index dc10370..e1f53f4 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ }, "devDependencies": { "@types/imagemagick": "0.0.35", + "babel-plugin-transform-define": "2.1.4", "gray-matter": "4.0.3", "imagemagick": "0.1.3", "prettier": "3.2.5", diff --git a/public/fonts/noto-sans-jp-v40-japanese-700.eot b/public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-700.eot similarity index 100% rename from public/fonts/noto-sans-jp-v40-japanese-700.eot rename to public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-700.eot diff --git a/public/fonts/noto-sans-jp-v40-japanese-700.svg b/public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-700.svg similarity index 100% rename from public/fonts/noto-sans-jp-v40-japanese-700.svg rename to public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-700.svg diff --git a/public/fonts/noto-sans-jp-v40-japanese-700.woff b/public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-700.woff similarity index 100% rename from public/fonts/noto-sans-jp-v40-japanese-700.woff rename to public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-700.woff diff --git a/public/fonts/noto-sans-jp-v40-japanese-700.woff2 b/public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-700.woff2 similarity index 100% rename from public/fonts/noto-sans-jp-v40-japanese-700.woff2 rename to public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-700.woff2 diff --git a/public/fonts/noto-sans-jp-v40-japanese-regular.eot b/public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-regular.eot similarity index 100% rename from public/fonts/noto-sans-jp-v40-japanese-regular.eot rename to public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-regular.eot diff --git a/public/fonts/noto-sans-jp-v40-japanese-regular.svg b/public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-regular.svg similarity index 100% rename from public/fonts/noto-sans-jp-v40-japanese-regular.svg rename to public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-regular.svg diff --git a/public/fonts/noto-sans-jp-v40-japanese-regular.woff b/public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-regular.woff similarity index 100% rename from public/fonts/noto-sans-jp-v40-japanese-regular.woff rename to public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-regular.woff diff --git a/public/fonts/noto-sans-jp-v40-japanese-regular.woff2 b/public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-regular.woff2 similarity index 100% rename from public/fonts/noto-sans-jp-v40-japanese-regular.woff2 rename to public/fonts/noto-sans-jp-v40/noto-sans-jp-v40-japanese-regular.woff2 diff --git a/src/components/SVG.tsx b/src/components/SVG.tsx index e5db481..e5824bc 100644 --- a/src/components/SVG.tsx +++ b/src/components/SVG.tsx @@ -54,6 +54,7 @@ function getInitialData(src: string, async?: boolean) { } else { // if (src.startsWith(config.resourceBaseURL)) // src = src.slice(config.resourceBaseURL.length); + if (src.startsWith(config.base)) src = src.slice(config.base.length); src = path.join(process.cwd(), "public", src); diff --git a/src/entry-client.tsx b/src/entry-client.tsx index 15c463b..07c3085 100644 --- a/src/entry-client.tsx +++ b/src/entry-client.tsx @@ -3,3 +3,4 @@ import { mount, StartClient } from "@solidjs/start/client"; mount(() => , document.getElementById("app")!); +console.log(import.meta.MIB); diff --git a/src/ssg/getArticles.ssg.bundled_63z57dui99b.mjs b/src/ssg/getArticles.ssg.bundled_63z57dui99b.mjs new file mode 100644 index 0000000..2021c06 --- /dev/null +++ b/src/ssg/getArticles.ssg.bundled_63z57dui99b.mjs @@ -0,0 +1,32 @@ +// src/ssg/getArticles.ssg.ts +import fs from "fs"; +import matter from "gray-matter"; +import path from "path"; +var base = "./src/articles"; +var files = fs.readdirSync(base); +var getArticlesSSG = () => { + return files.map((x) => { + try { + const raw = fs.readFileSync(path.join(base, x, "article.mdx")).toString(); + const frontmatter = matter(raw).data; + const title = frontmatter.title ?? raw.match(/# [^\n]*/)[0].slice(2); + const description = raw.match(/# [^\n]+\n+([\s\S]+?)(?=\n\n)/)?.[1]; + const url = `/articles/${x.split(".")[0]}`; + const date = x.split("-").slice(0, 3).reverse().join("."); + return { title, url, description, date }; + } catch (err) { + } + }).filter(Boolean).reverse(); +}; +var watchFiles = files.map((x) => path.resolve(base, x, "article.mdx")); +var getArticles_ssg_default = async () => { + return { + data: getArticlesSSG(), + watchFiles + }; +}; +export { + getArticles_ssg_default as default, + getArticlesSSG +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL3NzZy9nZXRBcnRpY2xlcy5zc2cudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9faW5qZWN0ZWRfZmlsZW5hbWVfXyA9IFwiL2hvbWUvc2hpcm8vcHJvamVjdC9wb3J0L3NyYy9zc2cvZ2V0QXJ0aWNsZXMuc3NnLnRzXCI7Y29uc3QgX19pbmplY3RlZF9kaXJuYW1lX18gPSBcIi9ob21lL3NoaXJvL3Byb2plY3QvcG9ydC9zcmMvc3NnXCI7Y29uc3QgX19pbmplY3RlZF9pbXBvcnRfbWV0YV91cmxfXyA9IFwiZmlsZTovLy9ob21lL3NoaXJvL3Byb2plY3QvcG9ydC9zcmMvc3NnL2dldEFydGljbGVzLnNzZy50c1wiO2ltcG9ydCBmcyBmcm9tIFwiZnNcIjtcbmltcG9ydCBtYXR0ZXIgZnJvbSBcImdyYXktbWF0dGVyXCI7XG5pbXBvcnQgcGF0aCBmcm9tIFwicGF0aFwiO1xuXG5jb25zdCBiYXNlID0gXCIuL3NyYy9hcnRpY2xlc1wiO1xuY29uc3QgZmlsZXMgP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Vk7QUFDekIsU0FBTztBQUFBLElBQ0wsTUFBTSxlQUFlO0FBQUEsSUFDckI7QUFBQSxFQUNGO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg== diff --git a/src/ssg/getArticles.ssg.bundled_91n3lh5iqun.mjs b/src/ssg/getArticles.ssg.bundled_91n3lh5iqun.mjs new file mode 100644 index 0000000..2021c06 --- /dev/null +++ b/src/ssg/getArticles.ssg.bundled_91n3lh5iqun.mjs @@ -0,0 +1,32 @@ +// src/ssg/getArticles.ssg.ts +import fs from "fs"; +import matter from "gray-matter"; +import path from "path"; +var base = "./src/articles"; +var files = fs.readdirSync(base); +var getArticlesSSG = () => { + return files.map((x) => { + try { + const raw = fs.readFileSync(path.join(base, x, "article.mdx")).toString(); + const frontmatter = matter(raw).data; + const title = frontmatter.title ?? raw.match(/# [^\n]*/)[0].slice(2); + const description = raw.match(/# [^\n]+\n+([\s\S]+?)(?=\n\n)/)?.[1]; + const url = `/articles/${x.split(".")[0]}`; + const date = x.split("-").slice(0, 3).reverse().join("."); + return { title, url, description, date }; + } catch (err) { + } + }).filter(Boolean).reverse(); +}; +var watchFiles = files.map((x) => path.resolve(base, x, "article.mdx")); +var getArticles_ssg_default = async () => { + return { + data: getArticlesSSG(), + watchFiles + }; +}; +export { + getArticles_ssg_default as default, + getArticlesSSG +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL3NzZy9nZXRBcnRpY2xlcy5zc2cudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9faW5qZWN0ZWRfZmlsZW5hbWVfXyA9IFwiL2hvbWUvc2hpcm8vcHJvamVjdC9wb3J0L3NyYy9zc2cvZ2V0QXJ0aWNsZXMuc3NnLnRzXCI7Y29uc3QgX19pbmplY3RlZF9kaXJuYW1lX18gPSBcIi9ob21lL3NoaXJvL3Byb2plY3QvcG9ydC9zcmMvc3NnXCI7Y29uc3QgX19pbmplY3R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UUFBUSxFQUFFLEtBQUssR0FBRztBQUN4RCxhQUFPLEVBQUUsT0FBTyxLQUFLLGFBQWEsS0FBSztBQUFBLElBQ3pDLFNBQVMsS0FBSztBQUFBLElBRWQ7QUFBQSxFQUNGLENBQUMsRUFDQSxPQUFPLE9BQU8sRUFDZCxRQUFRO0FBQ2I7QUFDQSxJQUFNLGFBQWEsTUFBTSxJQUFJLENBQUMsTUFBTSxLQUFLLFFBQVEsTUFBTSxHQUFHLGFBQWEsQ0FBQztBQUV4RSxJQUFPLDBCQUFRLFlBQVk7QUFDekIsU0FBTztBQUFBLElBQ0wsTUFBTSxlQUFlO0FBQUEsSUFDckI7QUFBQSxFQUNGO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg== diff --git a/src/ssg/getArticles.ssg.bundled_ctqcxhuz6r5.mjs b/src/ssg/getArticles.ssg.bundled_ctqcxhuz6r5.mjs new file mode 100644 index 0000000..2021c06 --- /dev/null +++ b/src/ssg/getArticles.ssg.bundled_ctqcxhuz6r5.mjs @@ -0,0 +1,32 @@ +// src/ssg/getArticles.ssg.ts +import fs from "fs"; +import matter from "gray-matter"; +import path from "path"; +var base = "./src/articles"; +var files = fs.readdirSync(base); +var getArticlesSSG = () => { + return files.map((x) => { + try { + const raw = fs.readFileSync(path.join(base, x, "article.mdx")).toString(); + const frontmatter = matter(raw).data; + const title = frontmatter.title ?? raw.match(/# [^\n]*/)[0].slice(2); + const description = raw.match(/# [^\n]+\n+([\s\S]+?)(?=\n\n)/)?.[1]; + const url = `/articles/${x.split(".")[0]}`; + const date = x.split("-").slice(0, 3).reverse().join("."); + return { title, url, description, date }; + } catch (err) { + } + }).filter(Boolean).reverse(); +}; +var watchFiles = files.map((x) => path.resolve(base, x, "article.mdx")); +var getArticles_ssg_default = async () => { + return { + data: getArticlesSSG(), + watchFiles + }; +}; +export { + getArticles_ssg_default as default, + getArticlesSSG +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291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BQUU7QUFFaEMsWUFBTSxRQUFRLFlBQVksU0FBUyxJQUFJLE1BQU0sVUFBVSxFQUFHLENBQUMsRUFBRSxNQUFNLENBQUM7QUFDcEUsWUFBTSxjQUFjLElBQUksTUFBTSwrQkFBK0IsSUFBSSxDQUFDO0FBRWxFLFlBQU0sTUFBTSxhQUFhLEVBQUUsTUFBTSxHQUFHLEVBQUUsQ0FBQyxDQUFDO0FBQ3hDLFlBQU0sT0FBTyxFQUFFLE1BQU0sR0FBRyxFQUFFLE1BQU0sR0FBRyxDQUFDLEVBQUUsUUFBUSxFQUFFLEtBQUssR0FBRztBQUN4RCxhQUFPLEVBQUUsT0FBTyxLQUFLLGFBQWEsS0FBSztBQUFBLElBQ3pDLFNBQVMsS0FBSztBQUFBLElBRWQ7QUFBQSxFQUNGLENBQUMsRUFDQSxPQUFPLE9BQU8sRUFDZCxRQUFRO0FBQ2I7QUFDQSxJQUFNLGFBQWEsTUFBTSxJQUFJLENBQUMsTUFBTSxLQUFLLFFBQVEsTUFBTSxHQUFHLGFBQWEsQ0FBQztBQUV4RSxJQUFPLDBCQUFRLFlBQVk7QUFDekIsU0FBTztBQUFBLElBQ0wsTUFBTSxlQUFlO0FBQUEsSUFDckI7QUFBQSxFQUNGO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg== diff --git a/src/ssg/getArticles.ssg.bundled_mn9geyqkiu.mjs b/src/ssg/getArticles.ssg.bundled_mn9geyqkiu.mjs new file mode 100644 index 0000000..2021c06 --- /dev/null +++ b/src/ssg/getArticles.ssg.bundled_mn9geyqkiu.mjs @@ -0,0 +1,32 @@ +// src/ssg/getArticles.ssg.ts +import fs from "fs"; +import matter from "gray-matter"; +import path from "path"; +var base = "./src/articles"; +var files = fs.readdirSync(base); +var getArticlesSSG = () => { + return files.map((x) => { + try { + const raw = fs.readFileSync(path.join(base, x, "article.mdx")).toString(); + const frontmatter = matter(raw).data; + const title = frontmatter.title ?? raw.match(/# [^\n]*/)[0].slice(2); + const description = raw.match(/# [^\n]+\n+([\s\S]+?)(?=\n\n)/)?.[1]; + const url = `/articles/${x.split(".")[0]}`; + const date = x.split("-").slice(0, 3).reverse().join("."); + return { title, url, description, date }; + } catch (err) { + } + }).filter(Boolean).reverse(); +}; +var watchFiles = files.map((x) => path.resolve(base, x, "article.mdx")); +var getArticles_ssg_default = async () => { + return { + data: getArticlesSSG(), + watchFiles + }; +}; +export { + getArticles_ssg_default as default, + getArticlesSSG +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL3NzZy9nZXRBcnRpY2xlcy5zc2cudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9faW5qZWN0ZWRfZmlsZW5hbWVfXyA9IFwiL2hvbWUvc2hpcm8vcHJvamVjdC9wb3J0L3NyYy9zc2cvZ2V0QXJ0aWNsZXMuc3NnLnRzXCI7Y29uc3QgX19pbmplY3RlZF9kaXJuYW1lX18gPSBcIi9ob21lL3NoaXJvL3Byb2plY3QvcG9ydC9zcmMvc3NnXCI7Y29uc3QgX19pbmplY3RlZF9pbXBvcnRfbWV0YV91cmxfXyA9IFwiZmlsZTovLy9ob21lL3NoaXJvL3Byb2plY3QvcG9ydC9zcmMvc3NnL2dldEFydGljbGVzLnNzZy50c1wiO2ltcG9ydCBmcyBmcm9tIFwiZnNcIjtcbmltcG9ydCBtYXR0ZXIgZnJvbSBcImdyYXktbWF0dGVyXCI7XG5pbXBvcnQgcGF0aCBmcm9tIFwicGF0aFwiO1xuXG5jb25zdCBiYXNlID0gXCIuL3NyYy9hcnRpY2xlc1wiO1xuY29uc3QgZmlsZXMgPSBmcy5yZWFkZGlyU3luYyhiYXNlKTtcblxuZXhwb3J0IGNvbnN0IGdldEFydGljbGVzU1NHID0gKCkgPT4ge1xuICByZXR1cm4gZmlsZXNcbiAgICAubWFwKCh4KSA9PiB7XG4gICAgICB0cnkge1xuICAgICAgICBjb25zdCByYXcgPSBmc1xuIC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/ssg/getArticles.ssg.ts +++ b/src/ssg/getArticles.ssg.ts @@ -16,7 +16,6 @@ export const getArticlesSSG = () => { const title = frontmatter.title ?? raw.match(/# [^\n]*/)![0].slice(2); const description = raw.match(/# [^\n]+\n+([\s\S]+?)(?=\n\n)/)?.[1]; - console.log(description); const url = `/articles/${x.split(".")[0]}`; const date = x.split("-").slice(0, 3).reverse().join("."); diff --git a/src/ssg/getGalleryPictures.ssg.bundled_29c8vnt4207.mjs b/src/ssg/getGalleryPictures.ssg.bundled_29c8vnt4207.mjs new file mode 100644 index 0000000..8dcc835 --- /dev/null +++ b/src/ssg/getGalleryPictures.ssg.bundled_29c8vnt4207.mjs @@ -0,0 +1,30 @@ +// src/ssg/getGalleryPictures.ssg.ts +import fs from "fs"; +import path from "path"; +var base = "./public/generated/gallery"; +var getGalleryPicturesSSG = () => { + return Promise.all( + fs.readdirSync(base).filter((x) => !x.includes(".thumbnail")).filter((x) => !x.includes(".meta")).map(async (x) => { + const { name, ext } = path.parse(x); + const prefix = "/generated/gallery"; + const meta = JSON.parse( + (await fs.promises.readFile(path.join(base, `${name}.meta.json`))).toString() + ); + return { + url: `${prefix}/${x}`, + thumbnailUrl: `${prefix}/${name}.thumbnail${ext}`, + meta + }; + }).filter(Boolean) + ); +}; +var getGalleryPictures_ssg_default = async () => { + return { + data: await getGalleryPicturesSSG() + }; +}; +export { + getGalleryPictures_ssg_default as default, + getGalleryPicturesSSG +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL3NzZy9nZXRHYWxsZXJ5UGljdHVyZXMuc3NnLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBfX2luamVjdGVkX2ZpbGVuYW1lX18gPSBcIi9ob21lL3NoaXJvL3Byb2plY3QvcG9ydC9zcmMvc3NnL2dldEdhbGxlcnlQaWN0dXJlcy5zc2cudHNcIjtjb25zdCBfX2luamVjdGVkX2Rpcm5hbWVfXyA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0FBTztBQUFBLEVBQ25CO0FBQ0Y7QUFFQSxJQUFPLGlDQUFRLFlBQVk7QUFDekIsU0FBTztBQUFBLElBQ0wsTUFBTSxNQUFNLHNCQUFzQjtBQUFBLEVBQ3BDO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg== diff --git a/src/ssg/getGalleryPictures.ssg.bundled_6tlbhn5766r.mjs b/src/ssg/getGalleryPictures.ssg.bundled_6tlbhn5766r.mjs new file mode 100644 index 0000000..8dcc835 --- /dev/null +++ b/src/ssg/getGalleryPictures.ssg.bundled_6tlbhn5766r.mjs @@ -0,0 +1,30 @@ +// src/ssg/getGalleryPictures.ssg.ts +import fs from "fs"; +import path from "path"; +var base = "./public/generated/gallery"; +var getGalleryPicturesSSG = () => { + return Promise.all( + fs.readdirSync(base).filter((x) => !x.includes(".thumbnail")).filter((x) => !x.includes(".meta")).map(async (x) => { + const { name, ext } = path.parse(x); + const prefix = "/generated/gallery"; + const meta = JSON.parse( + (await fs.promises.readFile(path.join(base, `${name}.meta.json`))).toString() + ); + return { + url: `${prefix}/${x}`, + thumbnailUrl: `${prefix}/${name}.thumbnail${ext}`, + meta + }; + }).filter(Boolean) + ); +}; +var getGalleryPictures_ssg_default = async () => { + return { + data: await getGalleryPicturesSSG() + }; +}; +export { + getGalleryPictures_ssg_default as default, + getGalleryPicturesSSG +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL3NzZy9nZXRHYWxsZXJ5UGljdHVyZXMuc3NnLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBfX2luamVjdGVkX2ZpbGVuYW1lX18gPSBcIi9ob21lL3NoaXJvL3Byb2plY3QvcG9ydC9zcmMvc3NnL2dldEdhbGxlcnlQaWN0dXJlcy5zc2cudHNcIjtjb25zdCBfX2luamVjdGVkX2Rpcm5hbWVfXyA9IFwiL2hvbWUvc2hpcm8vcHJvamVjdC9wb3J0L3NyYy9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DQUFRLFlBQVk7QUFDekIsU0FBTztBQUFBLElBQ0wsTUFBTSxNQUFNLHNCQUFzQjtBQUFBLEVBQ3BDO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg== diff --git a/src/ssg/getGalleryPictures.ssg.bundled_l2vee7p0bas.mjs b/src/ssg/getGalleryPictures.ssg.bundled_l2vee7p0bas.mjs new file mode 100644 index 0000000..8dcc835 --- /dev/null +++ b/src/ssg/getGalleryPictures.ssg.bundled_l2vee7p0bas.mjs @@ -0,0 +1,30 @@ +// src/ssg/getGalleryPictures.ssg.ts +import fs from "fs"; +import path from "path"; +var base = "./public/generated/gallery"; +var getGalleryPicturesSSG = () => { + return Promise.all( + fs.readdirSync(base).filter((x) => !x.includes(".thumbnail")).filter((x) => !x.includes(".meta")).map(async (x) => { + const { name, ext } = path.parse(x); + const prefix = "/generated/gallery"; + const meta = JSON.parse( + (await fs.promises.readFile(path.join(base, `${name}.meta.json`))).toString() + ); + return { + url: `${prefix}/${x}`, + thumbnailUrl: `${prefix}/${name}.thumbnail${ext}`, + meta + }; + }).filter(Boolean) + ); +}; +var getGalleryPictures_ssg_default = async () => { + return { + data: await getGalleryPicturesSSG() + }; +}; +export { + getGalleryPictures_ssg_default as default, + getGalleryPicturesSSG +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL3NzZy9nZXRHYWxsZXJ5UGljdHVyZXMuc3NnLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBfX2luamVjdGVkX2ZpbGVuYW1lX18gPSBcIi9ob21lL3NoaXJvL3Byb2plY3QvcG9ydC9zcmMvc3NnL2dldEdhbGxlcnlQaWN0dXJlcy5zc2cudHNcIjtjb25zdCBfX2luamVjdGVkX2Rpcm5hbWVfXyA9IFwiL2hvbWUvc2hpcm8vcHJvamVjdC9wb3J0L3NyYy9zc2dcIjtjb25zdCBfX2luamVjdGVkX2ltcG9ydF9tZXRhX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TSxNQUFNLHNCQUFzQjtBQUFBLEVBQ3BDO0FBQ0Y7IiwKICAibmFtZXMiOiBbXQp9Cg== diff --git a/src/ssg/getGalleryPictures.ssg.bundled_n2t29pko1d.mjs b/src/ssg/getGalleryPictures.ssg.bundled_n2t29pko1d.mjs new file mode 100644 index 0000000..8dcc835 --- /dev/null +++ b/src/ssg/getGalleryPictures.ssg.bundled_n2t29pko1d.mjs @@ -0,0 +1,30 @@ +// src/ssg/getGalleryPictures.ssg.ts +import fs from "fs"; +import path from "path"; +var base = "./public/generated/gallery"; +var getGalleryPicturesSSG = () => { + return Promise.all( + fs.readdirSync(base).filter((x) => !x.includes(".thumbnail")).filter((x) => !x.includes(".meta")).map(async (x) => { + const { name, ext } = path.parse(x); + const prefix = "/generated/gallery"; + const meta = JSON.parse( + (await fs.promises.readFile(path.join(base, `${name}.meta.json`))).toString() + ); + return { + url: `${prefix}/${x}`, + thumbnailUrl: `${prefix}/${name}.thumbnail${ext}`, + meta + }; + }).filter(Boolean) + ); +}; +var getGalleryPictures_ssg_default = async () => { + return { + data: await getGalleryPicturesSSG() + }; +}; +export { + getGalleryPictures_ssg_default as default, + getGalleryPicturesSSG +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsic3JjL3NzZy9nZXRHYWxsZXJ5UGljdHVyZXMuc3NnLnRzIl0sCiAgInNvdXJjZXNDb250ZW50IjogWyJjb25zdCBfX2luamVjdGVkX2ZpbGVuYW1lX18gPSBcIi9ob21lL3NoaXJvL3Byb2plY3QvcG9ydC9zcmMvc3NnL2dldEdhbGxlcnlQaWN0dXJlcy5zc2cudHNcIjtjb25zdCBfX2luamVjdGVkX2Rpcm5hbWVfXyA9IFwiL2hvbWUvc2hpcm8vcHJvamVjdC9wb3J0L3NyYy9zc2dcIjtjb25zdCBfX2luamVjdGVkX2ltcG9ydF9tZXRhX3VybF9fID0gXCJmaWxlOi8vL2hvbWUvc2hpcm8vcHJvamVjdC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KICAibmFtZXMiOiBbXQp9Cg== diff --git a/src/style/fontFaces.tsx b/src/style/fontFaces.tsx index 9516ffc..4dc698d 100644 --- a/src/style/fontFaces.tsx +++ b/src/style/fontFaces.tsx @@ -4,7 +4,12 @@ const japaneseCodeRange = (show: boolean) => show ? `unicode-range: U+3000-30FF , U+FF00-FFEF , U+4E00-9FAF ;` : ""; const nameSuffix = (isFull: boolean) => (isFull ? "" : " JP Only"); -const interPath = `/fonts/inter-3.19-roman/Inter`; +// Hack linaria can't deal with import.meta, not even with babel +const base = (process.env.BASE_URL ?? "").replace("/_build", ""); + +const fontPath = `${base}/fonts`; +const notoPath = `${fontPath}/noto-sans-jp-v40`; +const interPath = `${fontPath}/inter-3.19-roman`; // language=SCSS const notoFragments = (isFull: boolean, fontLoader?: FontLoader) => ` @@ -15,17 +20,17 @@ const notoFragments = (isFull: boolean, fontLoader?: FontLoader) => ` font-style: normal; font-weight: 400; font-display: swap; - src: url('${interPath}/noto-sans-jp-v40-japanese-regular.eot'); /* IE9 Compat Modes */ + src: url('${notoPath}/noto-sans-jp-v40-japanese-regular.eot'); /* IE9 Compat Modes */ src: local('Noto Sans Japanese Regular'), local('NotoSansJapanese-Regular'), - url('${interPath}/noto-sans-jp-v40-japanese-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('${interPath}/noto-sans-jp-v40-japanese-regular.woff2') format('woff2'), /* Super Modern Browsers */ - url('${interPath}/noto-sans-jp-v40-japanese-regular.woff') format('woff'), /* Modern Browsers */ - url('${interPath}/noto-sans-jp-v40-japanese-regular.svg#NotoSansJP') format('svg'); /* Legacy iOS */ + url('${notoPath}/noto-sans-jp-v40-japanese-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('${notoPath}/noto-sans-jp-v40-japanese-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('${notoPath}/noto-sans-jp-v40-japanese-regular.woff') format('woff'), /* Modern Browsers */ + url('${notoPath}/noto-sans-jp-v40-japanese-regular.svg#NotoSansJP') format('svg'); /* Legacy iOS */ ${ fontLoader != null ? `src: ${fontLoader( - `${interPath}/noto-sans-jp-v40-japanese-regular.woff2`, + `${notoPath}/noto-sans-jp-v40-japanese-regular.woff2`, "woff2" )};` : `` @@ -39,17 +44,17 @@ const notoFragments = (isFull: boolean, fontLoader?: FontLoader) => ` font-style: normal; font-weight: 700; font-display: swap; - src: url('${interPath}/noto-sans-jp-v40-japanese-700.eot'); /* IE9 Compat Modes */ + src: url('${notoPath}/noto-sans-jp-v40-japanese-700.eot'); /* IE9 Compat Modes */ src: local('Noto Sans Japanese Medium'), local('NotoSansJapanese-Medium'), - url('${interPath}/noto-sans-jp-v40-japanese-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ - url('${interPath}/noto-sans-jp-v40-japanese-700.woff2') format('woff2'), /* Super Modern Browsers */ - url('${interPath}/noto-sans-jp-v40-japanese-700.woff') format('woff'), /* Modern Browsers */ - url('${interPath}/noto-sans-jp-v40-japanese-700.svg#NotoSansJP') format('svg'); /* Legacy iOS */ + url('${notoPath}/noto-sans-jp-v40-japanese-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('${notoPath}/noto-sans-jp-v40-japanese-700.woff2') format('woff2'), /* Super Modern Browsers */ + url('${notoPath}/noto-sans-jp-v40-japanese-700.woff') format('woff'), /* Modern Browsers */ + url('${notoPath}/noto-sans-jp-v40-japanese-700.svg#NotoSansJP') format('svg'); /* Legacy iOS */ ${ fontLoader != null ? `src: ${fontLoader( - `${interPath}/noto-sans-jp-v40-japanese-700.woff2`, + `${notoPath}/noto-sans-jp-v40-japanese-700.woff2`, "woff2" )};` : `` @@ -75,11 +80,11 @@ export const fontFaceFragment = (fontLoader?: FontLoader) => ` font-weight: 400; font-display: swap; src: local(''), - url('${interPath}-Regular-Roman.woff2') format('woff2'), /* Super Modern Browsers */ - url('${interPath}-Regular-Roman.woff') format('woff'), /* Modern Browsers */ + url('${interPath}/Inter-Regular-Roman.woff2') format('woff2'), /* Super Modern Browsers */ + url('${interPath}/Inter-Regular-Roman.woff') format('woff'), /* Modern Browsers */ ${ fontLoader != null - ? `src: ${fontLoader(`${interPath}-Regular-Roman.woff2`, "woff2")};` + ? `src: ${fontLoader(`${interPath}/Inter-Regular-Roman.woff2`, "woff2")};` : `` } } @@ -90,11 +95,11 @@ export const fontFaceFragment = (fontLoader?: FontLoader) => ` font-weight: 400; font-display: swap; src: local(''), - url('${interPath}-Italic-Roman.woff2') format('woff2'), /* Super Modern Browsers */ - url('${interPath}-Italic-Roman.woff') format('woff'), /* Modern Browsers */ + url('${interPath}/Inter-Italic-Roman.woff2') format('woff2'), /* Super Modern Browsers */ + url('${interPath}/Inter-Italic-Roman.woff') format('woff'), /* Modern Browsers */ ${ fontLoader != null - ? `src: ${fontLoader(`${interPath}-Italic-Roman.woff2`, "woff2")};` + ? `src: ${fontLoader(`${interPath}/Inter-Italic-Roman.woff2`, "woff2")};` : `` } } @@ -106,11 +111,11 @@ export const fontFaceFragment = (fontLoader?: FontLoader) => ` font-weight: 600; font-display: swap; src: local('Inter SemiBold'), - url('${interPath}-SemiBold-Roman.woff2') format('woff2'), /* Super Modern Browsers */ - url('${interPath}-SemiBold-Roman.woff') format('woff'), /* Modern Browsers */ + url('${interPath}/Inter-SemiBold-Roman.woff2') format('woff2'), /* Super Modern Browsers */ + url('${interPath}/Inter-SemiBold-Roman.woff') format('woff'), /* Modern Browsers */ ${ fontLoader != null - ? `src: ${fontLoader(`${interPath}-SemiBold-Roman.woff2`, "woff2")};` + ? `src: ${fontLoader(`${interPath}/Inter-SemiBold-Roman.woff2`, "woff2")};` : `` } } @@ -121,12 +126,12 @@ export const fontFaceFragment = (fontLoader?: FontLoader) => ` font-weight: 600; font-display: swap; src: local('Inter SemiBold'), - url('${interPath}-SemiBoldItalic-Roman.woff2') format('woff2'), /* Super Modern Browsers */ - url('${interPath}-SemiBoldItalic-Roman.woff') format('woff'), /* Modern Browsers */ + url('${interPath}/Inter-SemiBoldItalic-Roman.woff2') format('woff2'), /* Super Modern Browsers */ + url('${interPath}/Inter-SemiBoldItalic-Roman.woff') format('woff'), /* Modern Browsers */ ${ fontLoader != null ? `src: ${fontLoader( - `${interPath}-SemiBoldItalic-Roman.woff2`, + `${interPath}/Inter-SemiBoldItalic-Roman.woff2`, "woff2" )};` : `` diff --git a/vite/SSR/SSRPreload.tsx b/vite/SSR/SSRPreload.tsx index e0f0d3f..cf9f29a 100644 --- a/vite/SSR/SSRPreload.tsx +++ b/vite/SSR/SSRPreload.tsx @@ -1,5 +1,6 @@ import fs from "fs"; import { getRequestEvent } from "solid-js/web"; +import { config } from "~/config"; import { routeMap } from "../../src/routeMap"; import { createMatcher } from "./routerMatchingUtil"; @@ -10,9 +11,13 @@ const manifest = fs.existsSync(VITE_MANIFEST_PATH) ? JSON.parse(fs.readFileSync(VITE_MANIFEST_PATH).toString()) : {}; -const fixUrl = (url: string) => (url.startsWith("/") ? url : "/" + url); +const base = (import.meta.env.BASE_URL ?? "").replace("/_build", ""); + +const formatUrl = (url: string) => `${base}/${url}`; function renderAsset(url: string) { + url = `${(import.meta.env.BASE_URL ?? "").replace("/_build", "")}${url}`; + if (url.endsWith(".css")) return ; if (url.endsWith(".js")) return ; @@ -24,6 +29,8 @@ const push = (set: string[], item: string) => { }; const collectRec = (output: string[], filename: string, manifest: Manifest) => { + console.log("collect", filename, manifest[filename]); + for (const jsFilename of manifest[filename]?.imports ?? []) { collectRec(output, jsFilename, manifest); } @@ -34,13 +41,22 @@ const collectRec = (output: string[], filename: string, manifest: Manifest) => { } if (manifest[filename]?.file) { + let url = manifest[filename].file; + + url = url.startsWith("/") ? url.slice(1) : url; + push(output, manifest[filename].file); } }; const matchers: [(path: string) => boolean, string[]][] = Object.entries( - routeMap, -).map(([pattern, value]) => [createMatcher(pattern), value as string[]]); + routeMap +).map(([pattern, value]) => [ + createMatcher(`${config.base}${pattern}`), + value as string[], +]); + +console.log("<<< VITE", routeMap, manifest); export const preloadSSR = () => { const pathname = new URL(getRequestEvent()!.request.url).pathname; @@ -52,5 +68,7 @@ export const preloadSSR = () => { collectRec(filesToPreload, filename, manifest); } } - return filesToPreload.map(fixUrl).map(renderAsset); + console.log("<<< preload", pathname, filesToPreload); + + return filesToPreload.map(formatUrl).map(renderAsset); }; diff --git a/vite/linariaVitePlugin.ts b/vite/linariaVitePlugin.ts index f96143a..2a02ebc 100644 --- a/vite/linariaVitePlugin.ts +++ b/vite/linariaVitePlugin.ts @@ -4,82 +4,85 @@ import * as sass from "sass"; import { PluginOption } from "vite"; interface Options { - include?: RegExp[]; - exclude?: RegExp[]; + include?: RegExp[]; + exclude?: RegExp[]; } export const linariaVitePlugin = (options: Options = {}): PluginOption => { - return wyw({ - babelOptions: { - configFile: false, - presets: ["@babel/preset-typescript", "solid"], - plugins: [ - [ - "babel-plugin-transform-remove-imports", - { - test: options.exclude, - }, - ], - "@babel/plugin-transform-export-namespace-from", - ], - }, - rules: [ - { - action: (babelOptions, ast, code, config, babel) => { - // console.log("linaria", babelOptions.filename); - const t = babel.types; - const lines = ast.program.body; - for (let idx = 0; idx < lines.length; ++idx) { - const line = lines[idx]; + return wyw({ + babelOptions: { + configFile: false, + presets: ["@babel/preset-typescript", "solid"], + plugins: [ + [ + "babel-plugin-transform-remove-imports", + { + test: options.exclude, + }, + ], + "@babel/plugin-transform-export-namespace-from", + [ + "transform-define", + { + "process.env.BASE_URL": process.env.BASE_PATH, + // "import.meta.env.BASE_URL": process.env.BASE_PATH, + }, + ], + ], + }, + rules: [ + { + action: (babelOptions, ast, code, config, babel) => { + // console.log("linaria", babelOptions.filename); + const t = babel.types; + const lines = ast.program.body; + for (let idx = 0; idx < lines.length; ++idx) { + const line = lines[idx]; - // solid - if ( - line.type == "ExpressionStatement" && - line.expression.type == "CallExpression" && - line.expression.callee.type == "Identifier" && - line.expression.callee.name == "_$delegateEvents" - ) { - lines.splice(idx, 1); - --idx; - continue; - } + // solid + if ( + line.type == "ExpressionStatement" && + line.expression.type == "CallExpression" && + line.expression.callee.type == "Identifier" && + line.expression.callee.name == "_$delegateEvents" + ) { + lines.splice(idx, 1); + --idx; + continue; + } - // solid-refresh - if ( - line.type == "VariableDeclaration" && - line.declarations.length == 1 && - line.declarations[0].init?.type == - "CallExpression" && - line.declarations[0].init.callee.type == - "Identifier" && - (line.declarations[0].init.callee.name == - "_$$component" || - line.declarations[0].init.callee.name == - "_$$registry") - ) { - // lines.splice(idx, 1); - // --idx; - const id = line.declarations[0].id; - line.declarations[0] = t.variableDeclarator( - id, - t.objectExpression([]) - ); - // line.declarations[0].init = t.numericLiteral(0); - continue; - } - } - return shaker(babelOptions, ast, code, config, babel); - }, - }, - ], - displayName: true, - configFile: false, - preprocessor: (selector, cssText) => - sass.compileString( - selector.startsWith(".globals_") - ? cssText - : `${selector} { ${cssText} }` - ).css, - ...options, - }); + // solid-refresh + if ( + line.type == "VariableDeclaration" && + line.declarations.length == 1 && + line.declarations[0].init?.type == "CallExpression" && + line.declarations[0].init.callee.type == "Identifier" && + (line.declarations[0].init.callee.name == "_$$component" || + line.declarations[0].init.callee.name == "_$$registry") + ) { + // lines.splice(idx, 1); + // --idx; + const id = line.declarations[0].id; + line.declarations[0] = t.variableDeclarator( + id, + t.objectExpression([]) + ); + // line.declarations[0].init = t.numericLiteral(0); + continue; + } + } + return shaker(babelOptions, ast, code, config, babel); + }, + }, + ], + displayName: true, + configFile: false, + preprocessor: (selector, cssText) => + sass.compileString( + selector.startsWith(".globals_") + ? cssText + : `${selector} { ${cssText} }` + ).css, + ...options, + }); }; diff --git a/yarn.lock b/yarn.lock index 6f20607..4b10d26 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2359,6 +2359,14 @@ babel-plugin-jsx-dom-expressions@^0.37.19: html-entities "2.3.3" validate-html-nesting "^1.2.1" +babel-plugin-transform-define@2.1.4: + version "2.1.4" + resolved "https://registry.npmjs.org/babel-plugin-transform-define/-/babel-plugin-transform-define-2.1.4.tgz#8f7088211176a55a72788d584ceea9f691a021c1" + integrity sha512-NN9xFmyNvr4swPZkRWy+RZZoV0yHhPk/WoxpuIvcVkTyYf0xy/JTQeZVbVGX8hyJ0/NKKuxnt4BZz9No7BziVA== + dependencies: + lodash "^4.17.11" + traverse "0.6.6" + babel-plugin-transform-remove-imports@1.7.1: version "1.7.1" resolved "https://registry.npmjs.org/babel-plugin-transform-remove-imports/-/babel-plugin-transform-remove-imports-1.7.1.tgz#ce45ba5a485e10e31d04dc5d7506c8ddc65c060d" @@ -4399,7 +4407,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash@^4.17.15: +lodash@^4.17.11, lodash@^4.17.15: version "4.17.21" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -7048,6 +7056,11 @@ tr46@~0.0.3: resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== +traverse@0.6.6: + version "0.6.6" + resolved "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz#cbdf560fd7b9af632502fed40f918c157ea97137" + integrity sha512-kdf4JKs8lbARxWdp7RKdNzoJBhGUcIalSYibuGyHJbmk40pOysQ0+QPvlkCOICOivDWU2IJo2rkrxyTK2AH4fw== + trim-lines@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338"