diff --git a/Dockerfile b/Dockerfile index 122c74e..167ea24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM node:22-alpine AS build WORKDIR /app COPY package.json ./ COPY scripts ./scripts +COPY webfonts ./webfonts RUN npm run build FROM nginx:1.27-alpine AS runtime diff --git a/README.md b/README.md index a1bc834..93c7ec2 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ Minimal static homepage for `neeldhara.blog`. The build script fetches the RSS feed from each blog and writes `dist/index.html` -with the latest two entries per blog. +with the latest two entries per blog. It also copies the bundled Heliotrope +fonts into `dist/webfonts/`. ```sh npm run build diff --git a/scripts/build.mjs b/scripts/build.mjs index 91033af..8717058 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -1,4 +1,4 @@ -import { mkdir, writeFile } from "node:fs/promises"; +import { copyFile, mkdir, writeFile } from "node:fs/promises"; const blogs = [ { @@ -41,6 +41,13 @@ const blogs = [ const rssHostSuffix = process.env.RSS_HOST_SUFFIX ?? "neeldhara.email"; const publicHostSuffix = process.env.PUBLIC_HOST_SUFFIX ?? "neeldhara.blog"; const outDir = new URL("../dist/", import.meta.url); +const fontDir = new URL("../webfonts/", import.meta.url); +const fontFiles = [ + "heliotrope_3_regular.woff2", + "heliotrope_3_italic.woff2", + "heliotrope_3_bold.woff2", + "heliotrope_3_bold_italic.woff2", +]; function decodeXml(value) { return value @@ -123,7 +130,7 @@ function renderSiteIcon(blog) { } function renderBlog(blog, posts) { - return `
+ return `
${escapeHtml(blog.label)} @@ -149,13 +156,41 @@ const html = ` neeldhara.blog