swiftimg

Image hosting for Hugo — keep the repo lean, serve from a global CDN

Hugo's built-in image processing is fast, but every variant lives in `static/` after build, ballooning the deployment artifact. Externalising image storage to swiftimg keeps the repo and the build artifact small.

Try swiftimg freeSee the API

Heads-up

Hugo's `resources/_gen` cache helps with cold builds, but the artifact size compounds with every image variant. swiftimg moves that cost off-repo.

Step by step

  1. 1. Upload from the CLI

    Use `@swiftimg/cli` to push an image, or drop it at /upload and copy the URL.

    Shell
    swiftimg upload hero.png
  2. 2. Reference the URL from a partial

    Hugo templates accept absolute URLs in `img` tags without configuration.

    layouts/partials/hero.html
    {{- with .Params.hero }}
      <img src="{{ . }}" alt="{{ $.Title }}" />
    {{- end }}
  3. 3. Use a srcset for responsive delivery

    Append width hints to the URL to get a srcset on the Developer plan.

    Responsive srcset
    srcset="https://i.swiftimg.com/abc123.png?w=480&sig=... 480w,
            https://i.swiftimg.com/abc123.png?w=960&sig=... 960w,
            https://i.swiftimg.com/abc123.png?w=1920&sig=... 1920w"

Hugo — FAQ

Will Hugo's own image processing still work?

Yes — they coexist. Use in-repo `resources` for editorial control over a few hero images, and swiftimg for the long tail.

How does this affect build time?

Hugo no longer needs to resize each variant — that's the biggest win for sites with large image libraries.

Can I use this with the Hugo Modules / theme ecosystem?

Yes — themes just need an absolute URL. No theme-specific changes required.

See also

Ready to host your Hugo images?

Start free, then unlock the full API, transforms, signed URLs, and a custom domain on the Developer plan.