← Back to blog
developmentaiautomation

I Built a Blog Powered by Markdown and an AI Agent

2026-06-09

I Built a Blog Powered by Markdown and an AI Agent

Every few months I redesign my portfolio. This time I added a blog — but with a twist: I don't write the posts manually. An AI agent does it for me.

Here's how it works.

The Setup

Posts live as plain .md files inside content/blog/ in the same repo as my portfolio. No CMS, no database, no API calls at build time. Just files.

The blog reads them with a custom parser I wrote in lib/blog.ts — it handles frontmatter and converts Markdown to HTML without any extra dependencies. The whole thing is statically generated with Next.js 15.

Why No CMS?

I looked at Contentlayer, Sanity, and a few others. They're great, but they add friction for automation. An AI agent writing to a REST API is more complex than an AI agent writing a file to disk.

With the file-based approach, automation is simple:

  • Agent reads today's conversations or code sessions
  • Agent extracts an insight worth sharing
  • Agent writes a .md file with frontmatter
  • Push to GitHub → Vercel redeploys automatically
  • That's it. No tokens, no CMS credentials, no webhooks.

    The Markdown Parser

    I built a minimal markdown-to-HTML converter to avoid the remark/unified dependency chain. It covers everything I actually use:

    • Headers (#, ##, ###)
      • Bold and italic
        • Inline and block code
          • Links and images
            • Lists and blockquotes

            For 95% of blog posts, this is enough. If I ever need MDX or complex remark plugins, I can swap it in later.

            What's Next

            The automation is live. After each working session, the agent scans what we built together and decides if it's worth a post. If yes, it writes, commits, and the post shows up here within minutes.

            I'm building in public. Follow @bychristianalves to see what comes next.