Pocket Dev
Development Tools Migration

From Next.js to Hugo: Why I Ditched the CMS for Markdown Bliss

Nigel Holder ·
From Next.js to Hugo: Why I Ditched the CMS for Markdown Bliss

The Problem: When Your CMS Becomes Your Biggest Frustration

I started my blog with Next.js and Sanity CMS because I thought I’d be using the CMS extensively. The promise was simple: write content in a user-friendly interface, and let the system handle the rest. But reality hit hard.

Instead of focusing on creating valuable content, I found myself wrestling with:

  • Plugin dependencies for markdown rendering
  • Custom code for every formatting need
  • CMS limitations that required workarounds
  • Deployment complexity that slowed down my workflow

The irony wasn’t lost on me. I chose a CMS to simplify content creation, but ended up spending more time configuring and coding around it than actually writing. The “content-first” approach had become “configuration-first” frustration.

The Search: Using AI to Find Alternatives

When the CMS frustration reached its peak, I turned to AI to help me explore alternatives. My requirements were clear:

  1. No React-based solutions - Personal preference, but I find React code visually messy
  2. Self-hostable - Container deployment capability for future flexibility
  3. Developer-friendly - Stay in my code editor, not a web interface
  4. Performance-focused - Fast loading and SEO benefits

This eliminated options like Gatsby (React-based) and WordPress (too complex for my needs). I wanted something that could deploy anywhere via container if needed, while maintaining the option to use platforms like Vercel for convenience.

Why Hugo Won: The Perfect Developer Workflow

Enter Hugo. What immediately caught my attention was the template ecosystem - they all seemed to do exactly what I was looking for. As someone who’s not a UI designer, having professional templates that I could customize was a game-changer.

The Markdown Advantage

My workflow already centered around markdown:

  • Notion for note-taking and planning
  • Obsidian for knowledge management
  • ChatGPT for content refinement and editing

Hugo’s robust markdown engine made content porting incredibly smooth. Take my raw drafts, add the images I previously uploaded to Sanity, and boom - I was off to the races.

Developer-Friendly Configuration

Hugo’s configuration is straightforward and powerful:

# Simple, readable configuration
baseURL = "https://yourdomain.com"
title = "Your Site Title"
theme = "your-theme"
timeZone = "America/New_York"

# Performance optimizations built-in
[build]
  writeStats = true

[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

The Migration Experience: From Complex to Simple

Content Porting Workflow

The migration process was surprisingly straightforward:

  1. Export content from Sanity (JSON format)
  2. Convert to markdown with front matter
  3. Organize in Hugo structure (content/posts/)
  4. Add images to assets/images/
  5. Configure theme and styling

Performance Benefits

The results were immediate:

  • Build times: From minutes to seconds
  • Page load speeds: Sub-2 second loads
  • SEO scores: Perfect Lighthouse scores
  • Deployment: Simple static file uploads

Theme Customization

Hugo’s template system made customization painless:

// Custom styling in assets/scss/custom.scss
:root {
  --color-primary: #e8505b;
  --color-secondary: #9ac4f8;
  --font-primary: 'PT Sans', sans-serif;
}

Workflow Comparison: When Each Approach Makes Sense

Next.js + Sanity: Great for Teams

Perfect when you have:

  • Non-technical content creators
  • Multiple authors with different skill levels
  • Need for content approval workflows
  • Complex content relationships

The workflow:

Content Creator → Sanity CMS → Next.js API → Static Generation → Deployment

Hugo: Perfect for Developer-First Content

Ideal for:

  • Solo developers or technical teams
  • Markdown-native workflows
  • Performance-critical applications
  • Simple deployment requirements

The workflow:

Developer → Markdown Files → Hugo Build → Static Files → Deployment

Lessons Learned: Tool Selection Criteria

What I Wish I Knew Earlier

  1. Start with your workflow, not the tool

    • My markdown-heavy process was already Hugo-optimized
    • I was fighting my natural workflow with the CMS
  2. Consider the maintenance overhead

    • CMS plugins require updates and security patches
    • Static sites have minimal maintenance needs
  3. Evaluate deployment complexity

    • Vercel made Next.js deployment easy, but Hugo is even simpler
    • Static files can deploy anywhere

When to Stick with Next.js + CMS

Despite my migration, Next.js + Sanity remains excellent for:

  • Enterprise teams with non-technical content creators
  • Complex applications requiring dynamic functionality
  • Content-heavy sites with multiple content types
  • Teams needing content approval and workflow management

The Developer Experience: Why Hugo Wins for Solo Developers

Code Editor Integration

Everything stays in my preferred environment:

  • VS Code for all content and configuration
  • Git for version control and collaboration
  • Terminal for builds and deployment
  • No context switching between browser and editor

Rapid Iteration

The development cycle is incredibly fast:

# Start development server
hugo server

# Create new post
hugo new posts/my-post.md

# Build for production
hugo --gc --minify

Content Portability

Markdown files are:

  • Version controlled with your code
  • Backup friendly (simple text files)
  • Platform independent (can migrate anywhere)
  • AI-friendly (perfect for ChatGPT collaboration)

Performance and SEO Benefits

Static Site Advantages

Hugo’s static generation provides:

  • Perfect Core Web Vitals scores
  • Instant page loads (no server-side processing)
  • Better SEO (faster loading = better rankings)
  • Lower hosting costs (static files are cheap to serve)

SEO Optimization Made Simple

Hugo’s built-in SEO features:

# Front matter with SEO metadata
---
title: 'Your Post Title'
description: 'Compelling meta description for search results'
keywords: ['keyword1', 'keyword2']
og_image: '/images/og-image.jpg'
---

The Business Case: Why This Matters for Developers

Time Savings

The migration saved me:

  • 2-3 hours per week on CMS management
  • Faster content publishing (minutes vs hours)
  • Reduced deployment complexity
  • More time for actual content creation

Professional Benefits

As a developer showcasing your work:

  • Demonstrates technical expertise (custom static site)
  • Shows performance optimization skills
  • Proves deployment and DevOps knowledge
  • Reflects modern development practices

Looking Forward: The Content Creation Workflow

This migration isn’t just about the technology - it’s about creating a sustainable content creation process. In upcoming posts, I’ll share:

  • How to write articles with AI assistance
  • Professional review and editing workflows
  • SEO optimization strategies
  • Performance monitoring and improvement

Conclusion: Choose Your Workflow, Not Just Your Tools

The Next.js + Sanity workflow is excellent for teams with non-technical content creators. But for developers who want to stay in their code editor and focus on content creation, Hugo provides a superior experience.

Key Takeaways

  1. Match tools to your workflow - Don’t fight your natural process
  2. Consider maintenance overhead - Static sites require less ongoing work
  3. Evaluate deployment needs - Simple static files deploy anywhere
  4. Focus on content creation - Tools should enable, not hinder

Recommendations

  • For teams with non-technical writers: Stick with Next.js + CMS
  • For solo developers or technical teams: Consider Hugo
  • For performance-critical applications: Hugo’s static generation wins
  • For rapid prototyping and iteration: Hugo’s development speed is unmatched

The migration to Hugo has transformed my content creation process from a frustrating configuration exercise into a smooth, developer-friendly workflow. I’m writing more, publishing faster, and spending less time on tool management.

Stay tuned for the next posts where I’ll dive into the actual content creation workflow and how to get articles written and professionally reviewed efficiently!