diff --git a/articles/human-telepathy-is-here/index.md b/articles/human-telepathy-is-here/index.md index 9c1a0a3..2909c72 100644 --- a/articles/human-telepathy-is-here/index.md +++ b/articles/human-telepathy-is-here/index.md @@ -4,7 +4,7 @@ slug: human-telepathy-is-here date: 2026-07-13 author: "[Renox](/author/renox/) and gemini-3.1-pro-preview" description: "The biggest invention since the atomic bomb arrived more than five years ago. It’s non-invasive, long-range, and it’s already running." -header_image: "https://free.direct-img.link/nsa?src=wikimedia" +header_image: ./nsa-headquarters.webp tags: - NSA - telepathy @@ -14,7 +14,7 @@ tags: - aliens --- -![NSA headquarters at Fort Meade](https://free.direct-img.link/nsa?src=wikimedia) +![NSA headquarters at Fort Meade](./nsa-headquarters.webp) ## The Silent Manhattan Project diff --git a/articles/human-telepathy-is-here/nsa-headquarters.webp b/articles/human-telepathy-is-here/nsa-headquarters.webp new file mode 100644 index 0000000..8be1296 Binary files /dev/null and b/articles/human-telepathy-is-here/nsa-headquarters.webp differ diff --git a/scripts/generate-pages.mjs b/scripts/generate-pages.mjs index b8c002f..509ee6f 100644 --- a/scripts/generate-pages.mjs +++ b/scripts/generate-pages.mjs @@ -63,6 +63,8 @@ const run = async () => { articles.push({ ...data, + // "./img.webp" points at a file next to index.md, which gets copied to // + header_image: data.header_image?.replace(/^\.\//, `/${data.slug}/`), sourceFile: file, markdown: md, isUnlisted: unlisted.has(data.slug), diff --git a/scripts/lib/renderers.mjs b/scripts/lib/renderers.mjs index ab42008..ff7f9fb 100644 --- a/scripts/lib/renderers.mjs +++ b/scripts/lib/renderers.mjs @@ -98,7 +98,7 @@ export const renderArticle = (article, dates = articleDates(article)) => ` ${shellHead({ title: `${article.title} — apophenia.news`, desc: article.description, - image: article.header_image, + image: absUrl(article.header_image), url: `${SITE_URL}/${article.slug}/`, type: "article", ...dates, diff --git a/vite.config.js b/vite.config.js index 52d66fb..076ff00 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,9 +1,20 @@ import { defineConfig } from "vite"; +import fs from "node:fs"; import fg from "fast-glob"; +// Vite hashes images it finds in HTML into /assets/, but og:image and JSON-LD point at //, so ship those too +const articleAssets = { + name: "article-assets", + generateBundle() { + for (const fileName of fg.sync("*/*", { cwd: "src", ignore: ["**/*.html"] })) + this.emitFile({ type: "asset", fileName, source: fs.readFileSync(`src/${fileName}`) }); + } +}; + export default defineConfig({ root: "src", publicDir: "../public", + plugins: [articleAssets], build: { outDir: "../dist", emptyOutDir: true,