${fmtDate(a.date)}
-- ${escapeHtml(a.title)} -
-${escapeHtml(a.description || "")}
-diff --git a/scripts/generate-pages.mjs b/scripts/generate-pages.mjs index 4b115b8..ac5c888 100644 --- a/scripts/generate-pages.mjs +++ b/scripts/generate-pages.mjs @@ -1,323 +1,14 @@ import fs from "node:fs/promises"; -import path from "node:path"; import fg from "fast-glob"; import matter from "gray-matter"; import { marked } from "marked"; - -const ROOT = process.cwd(); -const SRC = path.join(ROOT, "src"); -const PUBLIC = path.join(ROOT, "public"); -const ARTICLES_GLOB = "articles/**/index.md"; -const SITE_URL = (process.env.SITE_URL || "https://apophenia.news").replace(/\/+$/, ""); +import { ARTICLES_GLOB, AUTHOR_PAGES, ROOT, SRC } from "./lib/constants.mjs"; +import { fixInternalLinks } from "./lib/utils.mjs"; +import { renderArticle, renderHome, renderWritePage, renderAuthorPage } from "./lib/renderers.mjs"; +import { ensureCleanGenerated, writeDiscoveryFiles, writePage } from "./lib/io.mjs"; marked.setOptions({ breaks: true, gfm: true }); -const logo = ` -`; - -const shellHead = ({ title, desc, image, url, type = "website" }) => ` - -
- - -Pattern Intelligence Journalism
-High-agency analysis at the intersection of AGI, consciousness, geopolitics, and first-contact logic.
-${fmtDate(a.date)}
-${escapeHtml(a.description || "")}
-${fmtDate(article.date)} • ${escapeHtml(article.author || "Apophenia")}
-${escapeHtml(article.description || "")}
-Contributor Program
-- Have a strong pattern-based story, analysis, or investigation? Send it to us. -
- ----
-title: "Your headline"
-slug: your-slug
-date: 2026-03-01
-author: Your Name or Alias
-description: "1-2 sentence summary"
-header_image: https://direct-img.link/your+image+query
-tags:
- - your-tag
- - another-tag
----
-