/images/blog-generated/hugoifier-is-open-source.webp

We’re open-sourcing Hugoifier, our tool for converting existing websites into production-ready Hugo static sites with integrated Decap CMS. It’s MIT licensed and available on PyPI.

pip install hugoifier
hugoifier complete path/to/site

Output lands in output/{name}/, ready for hugo serve or direct deployment.

The problem nobody wants to talk about

Website migrations are universally dreaded. Every dev shop has horror stories, and we’re no exception. Manual content extraction. Broken layouts. Lost SEO metadata. Missing images. Three weeks of copy-paste marathons that make experienced engineers question their career choices.

At CONFLICT, we kept running into this on client work. Someone needs to move off WordPress, or a Next.js app has grown unwieldy, or there’s a perfectly good static site buried in a legacy CMS that just needs to be liberated. Every time, the migration itself consumed more hours than building the new features the client actually wanted.

We got tired of solving it manually. So we built a tool.

Three input types, one output

Hugoifier handles three categories of source material:

  1. Hugo themes – assembles them, patches deprecated APIs, and adds CMS integration. If you’ve ever tried to modernize a Hugo theme that was last updated in 2019, you know this alone is worth the install.

  2. Next.js applications – captures server-rendered HTML from the dev server and converts it into Hugo templates. No manual extraction, no guessing at what the hydrated output looks like.

  3. Raw HTML sites – extracts markup directly into Hugo templates. Old-school static sites, exported WordPress pages, hand-coded HTML from 2014 – all fair game.

The conversion pipeline handles the structural mapping, template generation, and asset organization. You get a complete Hugo project, not a pile of files that need another week of stitching together.

AI as fallback, not primary engine

This is a deliberate design choice and worth explaining.

The core approach is direct HTML extraction. Parse the markup, map the structure, extract the content deterministically. This produces zero content loss because there’s no generation step – what’s on the page is what goes into the Hugo templates.

AI – supporting Anthropic, OpenAI, and Google backends via the HUGOIFIER_BACKEND environment variable – is used only as a fallback mechanism or for lightweight structural analysis. When deterministic extraction can’t resolve an ambiguous layout, the AI provides a second opinion. But the extracted content itself comes from the source HTML, not from a model’s interpretation of it.

We’ve seen too many “AI-powered” migration tools that essentially ask a language model to rewrite your website. That’s not migration – that’s content generation wearing a migration costume. Deterministic extraction produces more reliable results than generative approaches, and reliability is what matters when a client’s entire web presence is on the line.

Built-in CMS integration

Every converted site gets a working Decap CMS at /admin/ with GitHub OAuth. This isn’t an afterthought – it’s core to the value proposition. You’re not just getting a static site; you’re getting a static site that non-technical stakeholders can actually update.

Cloudflare Pages Functions handle the OAuth flow out of the box. Whitelabel customization is available via CLI flags:

hugoifier complete path/to/site \
  --cms-name "Client Portal" \
  --cms-logo "/images/logo.svg" \
  --cms-color "#1a1a2e"

The CMS config is generated to match your site’s content structure – collections, fields, and media folders are all wired up based on what Hugoifier finds during conversion.

Post-conversion AI commands

After the initial deterministic conversion, Hugoifier offers a set of AI-powered commands for enhancement:

  • Content generation – create new posts from prompts, maintaining the style and structure of existing content
  • SEO metadata – generate or enhance meta descriptions and Open Graph tags across the site
  • Image alt text – automatically generate descriptive alt text for images that are missing it
  • Default layouts – create template scaffolding for content types that need it

These are explicitly opt-in, post-conversion steps. The base conversion never depends on them. If you don’t set an API key, you still get a fully functional Hugo site – you just handle the SEO polish yourself.

Production-ready output

This isn’t a prototype. Hugoifier has 135 tests covering the conversion pipeline, template generation, CMS integration, and edge cases we’ve hit across real client projects. YAML-safe frontmatter handling means you won’t get bitten by the colons-in-titles problem that plagues every Hugo migration at least once.

The output structure is ready to deploy:

  • Clean Hugo directory layout with content/, layouts/, static/, and config/
  • Properly scoped templates with base layouts and partials
  • Asset references rewritten to match Hugo’s static file handling
  • Decap CMS configured and functional

Run hugo serve on the output and you’ve got a working site. Push to Cloudflare Pages, Netlify, or Vercel and you’ve got a production deployment.

Why we open-source our tools

Same philosophy as PlanOpticon. The code demonstrates the quality of work CONFLICT does. Open-sourcing production tools builds credibility in a way that blog posts and case studies can’t – you can read every line, run the tests, and judge for yourself.

The competitive advantage was never the code. It’s knowing what to build and how to deploy it for specific client contexts. A migration tool is useful; knowing which migration approach fits a particular business situation, how to handle the SEO transition, how to train the client’s team on the CMS, how to set up the deployment pipeline – that’s the work that actually requires a consultancy.

We’d rather have our tools out in the open, being used and improved, than sitting in a private repo collecting dust between client engagements.

Get started

Hugoifier requires Python 3.10+ and installs cleanly from PyPI:

pip install hugoifier

Point it at a site and run:

hugoifier complete path/to/site

That’s it. Check the output directory, run hugo serve, and see what you get.

If you’re staring down a migration and want to skip the manual extraction phase, give it a shot. If you hit an edge case we haven’t covered, open an issue.

Written by Leo M.