Skip to content

feat(website): Blog infrastructure with markdown-to-HTML build#70

Closed
vraspar wants to merge 1 commit intomainfrom
feat/blog-infrastructure
Closed

feat(website): Blog infrastructure with markdown-to-HTML build#70
vraspar wants to merge 1 commit intomainfrom
feat/blog-infrastructure

Conversation

@vraspar
Copy link
Copy Markdown
Owner

@vraspar vraspar commented Mar 28, 2026

Summary

Add a lightweight blog system that converts markdown posts to styled HTML matching the site's dark theme. No frameworks — just a 168-line build script using \marked\ + \gray-matter.

What's included

  • *\scripts/build-blog.js* — Reads markdown from \website/blog-src/posts/, converts to HTML with proper meta tags, OG tags, and clean URLs
  • *\website/blog/blog.css* — Blog-specific styles: nav, prose typography, post listing, responsive design
  • *\website/blog-src/posts/building-brain.md* — First blog post (migrated from \docs/blog/\ with frontmatter)
  • *.github/workflows/pages.yml* — Updated to run
    pm run build:blog\ before GitHub Pages deploy

How it works

\\�ash

Write a blog post

vim website/blog-src/posts/my-post.md

Build HTML

npm run build:blog

Push (GitHub Pages auto-deploys)

git push
\\

Output structure

\
website/blog/
├── index.html # Blog listing page
├── blog.css # Blog styles
└── building-brain/
└── index.html # Individual post (clean URL)
\\

Design decisions

  • No framework (Astro, 11ty, Jekyll all evaluated — overkill for 5-10 posts)
  • 1 new devDependency (\marked\ for md→html, \gray-matter\ already installed)
  • Matches existing theme (same CSS variables, fonts, dark palette)
  • Clean URLs (/blog/building-brain/\ not /blog/building-brain.html)
  • XSS-safe (all user content HTML-escaped in templates)
  • Upgrade path — if blog outgrows this, markdown files are 11ty-compatible

Add a lightweight blog system that converts markdown posts to styled HTML
matching the site's dark theme. No frameworks added, just a build script.

New files:
- scripts/build-blog.js: Converts md posts to HTML using marked + gray-matter
- website/blog-src/posts/: Markdown source directory for blog posts
- website/blog/blog.css: Blog-specific styles (nav, prose, index listing)
- website/blog/: Generated HTML output directory

Changes:
- package.json: Add build:blog script + marked devDependency
- .github/workflows/pages.yml: Run build:blog before GitHub Pages deploy

First post: Building Brain migrated from docs/blog/ with frontmatter.
Workflow: write md in blog-src/posts/ -> npm run build:blog -> push

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@vraspar vraspar force-pushed the feat/blog-infrastructure branch from 014b123 to b971fdf Compare March 28, 2026 22:47
@vraspar
Copy link
Copy Markdown
Owner Author

vraspar commented Mar 30, 2026

Superseded by Zine website PR #71 which includes blog infrastructure

@vraspar vraspar closed this Mar 30, 2026
@vraspar vraspar deleted the feat/blog-infrastructure branch March 30, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant