In the Astro vs Hexo decision, choose Hexo if you want a classic blog up quickly from a ready-made theme and you are happy to configure rather than code, and choose Astro if you want to build or customise the site with components, typed content, image optimisation and optional interactive islands. Both run on Node.js and output static HTML; Hexo is a blog engine with a theme system, Astro is a general content framework.
Hexo has been around since 2012 and is especially popular for personal and technical blogs, with well-known themes such as NexT, Butterfly and Fluid. Astro covers blogs too, but also marketing sites, docs and portfolios, and lets you mix static pages with server-rendered ones.
Key Takeaways
- Both are Node.js static site generators. Hexo is blog-focused and theme-driven; Astro is component-driven and covers any content site.
- Hexo themes are configured through
_config.ymlfiles. Astro themes are full source projects you edit directly.- Hexo templates use EJS, Nunjucks or Pug through renderer plugins. Astro uses
.astrocomponents plus any UI framework you add.- Astro adds typed content collections, image optimisation and server rendering; Hexo has a built-in CLI for creating posts and deploying.
- Hexo posts move to Astro with little change once Hexo-specific tag plugins are replaced.
Astro vs Hexo at a glance
| Astro | Hexo | |
|---|---|---|
| Focus | Any content-driven site | Blogs |
| Runtime | Node.js, Vite | Node.js |
| Templates | .astro components; React, Vue, Svelte, Solid islands |
EJS, Nunjucks, Pug and others via renderer plugins |
| Configuration | astro.config.mjs |
_config.yml plus a theme _config.yml |
| Content | Content collections with schemas | source/_posts/ with front matter |
| Images | astro:assets resizing and modern formats |
Plugins or theme features |
| Dev server | Vite with instant updates | hexo server |
| Deploy | Any static host; adapters for server routes | Any static host; hexo deploy with deployer plugins |
How each one is structured
A Hexo site separates content from presentation. You write posts in source/_posts/, pick a theme in themes/ or install it from npm, and set options in two YAML files: the site’s _config.yml and the theme’s config. Common work happens through the CLI:
npx hexo init my-blog
cd my-blog
npx hexo new "My first post" # creates source/_posts/My-first-post.md
npx hexo server # preview at localhost:4000
npx hexo generate # build to public/
An Astro site is a project you own end to end. Pages live in src/pages/, components in src/components/, content in collections. There is no separate theme layer; a theme is simply a starting project:
npm create astro@latest my-blog -- --template blog
cd my-blog
npm run dev # preview at localhost:4321
npm run build # build to dist/
That difference shapes everything else. With Hexo, you mostly configure someone else’s theme. With Astro, you edit the code.
Templates and customisation
Hexo themes are built from layout files rendered by whichever renderer plugin the theme uses, often EJS or Nunjucks. A post layout in EJS might look like this:
<!-- themes/my-theme/layout/post.ejs (Hexo) -->
<article>
<h1><%= page.title %></h1>
<time><%= date(page.date, 'MMMM D, YYYY') %></time>
<%- page.content %>
<%- partial('_partial/share', { url: page.permalink }) %>
</article>
Customising a Hexo theme beyond its options means editing these files or overriding them, and theme updates can overwrite your changes unless you fork the theme.
In Astro, the equivalent is a component with typed props:
---
// src/layouts/Post.astro
import Base from './Base.astro';
import Share from '../components/Share.astro';
interface Props { title: string; pubDate: Date }
const { title, pubDate } = Astro.props;
---
<Base title={title}>
<article>
<h1>{title}</h1>
<time datetime={pubDate.toISOString()}>{pubDate.toDateString()}</time>
<slot />
<Share url={Astro.url.pathname} />
</article>
</Base>
Components compose cleanly, accept slots, and can be type-checked with astro check. For a team that wants to shape the design, that is easier to maintain than layered template overrides. The Astro components guide covers the patterns.
Content, front matter and tag plugins
Hexo posts are Markdown with YAML front matter (title, date, tags, categories). Hexo also has tag plugins written in Nunjucks-style syntax inside Markdown, such as {% codeblock %}, {% youtube %} or {% asset_img %}, and post asset folders for images that live beside each post.
Astro reads the same Markdown, and content collections validate the front matter:
// src/content.config.ts
import { defineCollection } from 'astro:content';
import { z } from 'astro/zod';
import { glob } from 'astro/loaders';
const posts = defineCollection({
loader: glob({ pattern: '**/*.md', base: './src/content/posts' }),
schema: z.object({
title: z.string(),
date: z.coerce.date(),
tags: z.array(z.string()).default([]),
categories: z.array(z.string()).default([]),
}),
});
export const collections = { posts };
Hexo tag plugins do not work in Astro. Replace them with standard Markdown (code fences, image syntax) or, for embeds, MDX components. Images placed next to posts and referenced with relative paths are processed by Astro’s image pipeline automatically. See the content collections guide for loaders and schemas.
Themes and ecosystem
Hexo’s theme ecosystem is its biggest draw. Popular themes ship with search, comment systems, table of contents, dark mode and many layout options, all driven by config. For someone who wants a feature-rich blog without writing templates, that is hard to beat. Many Hexo themes and plugins are documented mainly in Chinese, which suits that community well and can be a hurdle for others.
Astro’s ecosystem is broader in scope: official integrations for MDX, RSS, sitemaps and every major host, Starlight for documentation, and a large set of themes on astro.build/themes, from free starters like AstroPaper to commercial designs. Astro themes are source code, so you get full control rather than an options panel. If you want a finished editorial design, the Komal blog and editorial themes are complete Astro 7 projects you can move your posts into.
Performance and JavaScript
Both generators output static HTML, so both can be very fast. The difference comes from the theme. A Hexo theme decides what JavaScript ships, and feature-rich themes often include jQuery or several scripts on every page.
Astro ships no JavaScript unless you add it. Plain <script> tags are bundled per component, and interactive widgets can be framework islands that load only when needed, for example a search box with client:idle. That makes it easier to keep a blog light as you add features. The Astro performance guide covers images, fonts and scripts.
Deployment
Hexo builds to public/ and has a hexo deploy command with deployer plugins (for example hexo-deployer-git) that push the output to a branch or server.
Astro builds to dist/. Most people connect the repository to Cloudflare Pages, Netlify or Vercel, or use the withastro/action workflow for GitHub Pages, so each push builds and deploys automatically. Astro can also render specific routes on demand with an adapter, which Hexo cannot do. The static hosting docs list host-specific steps.
Migrating from Hexo to Astro
- Start a project with
npm create astro@latest -- --template blog. - Copy
source/_posts/*.mdintosrc/content/posts/and add a schema matching your front matter. - Find Hexo tag plugins with a search for
{%and replace them with Markdown or MDX components. - Rebuild permalinks. Hexo’s default is
:year/:month/:day/:title/; reproduce it ingetStaticPaths()or add redirects inastro.config.mjs. - Recreate tag and category archive pages with dynamic routes such as
src/pages/tags/[tag].astro. - Add
@astrojs/rssand@astrojs/sitemapto replacehexo-generator-feedandhexo-generator-sitemap. - Compare old and new sitemaps before switching DNS.
When to choose Astro and when to choose Hexo
Choose Hexo if:
- You want a personal blog running today from a feature-rich theme.
- You prefer configuring options in YAML over editing templates.
- The Hexo theme and plugin you want already exist and are maintained.
Choose Astro if:
- You want full control of the design and markup.
- The site is more than a blog: product pages, docs, portfolio, landing pages.
- You want typed content, image optimisation and interactive islands.
- You may need server-rendered routes later.
FAQ
Is Astro better than Hexo for blogging?
It depends on how you work. Hexo is faster to start if you pick a theme and configure it. Astro is better if you want to customise the design, add components or grow the site beyond a blog, since every part of the project is editable source code.
Can I use Hexo themes in Astro?
No. Hexo themes are built from Hexo-specific layouts and helpers. You can recreate a Hexo theme’s design in Astro components, or start from an Astro theme with a similar look.
Are Hexo and Astro both static site generators?
Yes. Both build static HTML from Markdown. Astro can also render selected routes on the server with an adapter, which Hexo does not support.
Will my Hexo URLs change if I move to Astro?
Only if you let them. Astro builds whatever paths you define, so you can match Hexo’s permalink pattern in getStaticPaths() or add redirects for any URLs you change.
Does Hexo still get updates?
Yes, Hexo continues to publish releases on npm and GitHub. Check that the specific theme and plugins you depend on are maintained too, since those vary more than the core. The Astro migration guides cover moving from other generators if you decide to switch.