Hello, blog — building a fast static-feel blog with PHP and Markdown

Why I'm starting a blog on nzian.xyz, how it's built (Markdown + PHP rendering, file cache, content stored outside the web root), and what to expect next.

· 2 min read #meta #php #markdown

Welcome to the new blog on nzian.xyz. This first post explains why it exists, how it's built, and what kind of writing you can expect here.

Why a blog (and why now)

I've been freelancing on Laravel + Vue + WordPress projects for years. Most of what I learn ends up in scattered notes, Slack DMs, and chat threads with AI assistants. A blog is the obvious place to consolidate.

Three goals:

  1. Write things down once. If I solve a tricky bug, the writeup helps the next person who hits it (often: future me).
  2. Show how I work — including how I lean on AI tools and platforms as part of my workflow (more on that on /my-team).
  3. Pull better clients. SEO + concrete writeups beat a generic portfolio.

How this blog is built

The whole site is static HTML served by Caddy. I didn't want to bolt on WordPress or a JS framework just for a blog. So I went minimal:

  • Posts live in Markdown files with YAML front-matter, stored outside the web root at /var/lib/nzian-blog/posts/. Web users physically cannot read them; only the www-data user can.
  • A small PHP entry point (/blog/index.php) parses front-matter, renders Markdown to HTML using league/commonmark, and writes the result to a server-side cache file.
  • Subsequent requests serve the cached HTML directly. Editing the source .md invalidates the cache automatically (mtime check).
  • Tailwind handles styling. The prose plugin makes Markdown look good with no extra CSS.
// pseudocode
$post = $blog->getPost($slug);
echo $cache->getOrRender($post, fn() => $renderer->render($post));

What you'll find here

  • Build journals — real problems I'm solving on client projects, with code.
  • Tooling notes — what works, what didn't, why I switched.
  • Career posts — the freelancing-from-Bangladesh angle.

If a topic helps you, subscribe to the newsletter and I'll send the next one.

Thanks for reading.

Share:

Get new posts in your inbox

No spam. One short email per new article — practical PHP, Laravel, devops, and AI-assisted workflows.

Comments

Powered by GitHub Discussions via Giscus. A free GitHub account is required.