Scripts2026年4月24日·1 分钟阅读

Hexo — Fast Node.js Blog Framework with Plugin Ecosystem

Hexo is a fast, simple, and extensible blog framework powered by Node.js. It renders Markdown posts into static HTML in seconds and supports hundreds of themes and plugins.

assetLangBanner.body

Introduction

Hexo is a static blog framework for Node.js that turns Markdown files into a fully rendered website in seconds. It was designed for speed, simplicity, and extensibility, and has become one of the most popular blogging platforms among developers. With hundreds of themes and plugins, Hexo adapts to personal blogs, documentation sites, and portfolios.

What Hexo Does

  • Converts Markdown and other markup formats into static HTML pages at high speed
  • Provides a CLI for scaffolding posts, generating builds, deploying, and running a local dev server
  • Supports front matter (YAML/JSON/TOML) for per-post metadata like tags, categories, and dates
  • Renders with Nunjucks, EJS, or Pug templates and ships with Moment.js for date formatting
  • Deploys to GitHub Pages, Netlify, Vercel, S3, or any static host with built-in deployer plugins

Architecture Overview

Hexo reads source files from the source/ directory, parses front matter, processes Markdown through a rendering pipeline, applies theme layouts, and writes static output to public/. The entire pipeline is plugin-driven: generators create routes, renderers handle markup-to-HTML conversion, and deployers push output to hosting. Hexo uses a local JSON database (db.json) to track file states and enable incremental generation.

Self-Hosting & Configuration

  • Requires Node.js 14+ and npm; install the CLI globally with npm install -g hexo-cli
  • Edit _config.yml for site title, URL, permalink structure, theme selection, and plugin settings
  • Place posts in source/_posts/ as Markdown files with YAML front matter
  • Run hexo generate to build and hexo deploy to push to configured hosting targets
  • Themes are installed into themes/ and activated by name in _config.yml

Key Features

  • Sub-second generation for hundreds of posts using Node.js async I/O and file caching
  • Tag and category taxonomy system with automatic archive and index page generation
  • Asset folder support associates images and files with specific posts
  • Multi-language i18n support for building blogs in multiple locales
  • Extensible plugin API for custom generators, filters, helpers, and deployers

Comparison with Similar Tools

  • Hugo — Go-based SSG with faster raw build speed; Hexo offers a larger Node.js plugin ecosystem
  • Jekyll — Ruby-based with tight GitHub Pages integration; Hexo is faster and requires less Ruby toolchain setup
  • Gatsby — React-based with GraphQL data layer; Hexo is simpler and focused on blogging
  • VitePress — Vue-based for documentation; Hexo targets blogs with richer taxonomy features
  • Eleventy — flexible zero-config SSG; Hexo provides more opinionated blogging conventions out of the box

FAQ

Q: How fast is Hexo for large sites? A: Hexo generates hundreds of posts in under a second. Sites with thousands of posts may take a few seconds, and incremental builds help keep iteration fast.

Q: Can Hexo handle non-blog content? A: Yes. Hexo can generate any static site using custom page layouts, and many users build documentation and portfolio sites with it.

Q: How do themes work? A: Themes are standalone directories with layouts, partials, styles, and scripts. You can clone a theme into themes/ and activate it in _config.yml.

Q: Is Hexo still actively maintained? A: Yes. Hexo continues to receive releases, and the community maintains a large registry of themes and plugins.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产