Skip to content

Guide · Open source

How to use hexo-theme-next: install, configure and add pages

Updated · written with AI from the project's own documentation and checked against our catalogue data

hexo-theme-next (NexT) is a visual theme for Hexo, a tool that turns Markdown and text files into a static website such as a blog. It controls layout, menus, comment systems, social links and code highlighting. This guide shows you how to add the theme to an existing Hexo site, switch it on, and set up the common options.

NexTiissnan/hexo-theme-next · ★ 15.7k · MIT

Quick start

  1. 1Confirm your Hexo site. Change to the Hexo root directory and check that it contains node_modules, source, themes and _config.yml.
  2. 2Create the themes/next folder. Run mkdir themes/next from the Hexo root.
  3. 3Clone the theme. Run git clone with the tag you want, or without --branch for master.
  4. 4Set the theme. Set theme: next in the root _config.yml.
  5. 5Add menu pages. Create tags or categories pages and list them under menu in the theme config.
  6. 6Configure comments and social links. Add disqus_shortname or the duoshuo block, and fill in the social fields.

Check the prerequisites before you install

You need an existing Hexo site. The theme only works inside a Hexo site, so it is not useful on its own. The installation also uses Node.js and npm to install Hexo and its dependencies, and Git if you choose the git clone method.

  • A Hexo site (the README mentions Hexo 3 or above for the data-file feature; Hexo 2.x is still supported)
  • Node.js and npm
  • Git, if you use the git clone option

Install NexT into themes/next

Change to your Hexo root directory, the one that contains node_modules, source, themes and other folders. The README suggests the latest tagged release for most users, and the master branch for developers, who may get unstable code. Git clone gives you the whole repository, so you can switch between tags later.

The README shows this command to clone a specific tagged release, using v5.1.2 as the example. Replace the tag with any version from the tags list.

  • Stable: clone a tagged release (example shown in the README)
  • Latest master: clone without a tag; may be unstable
$ mkdir themes/next $ git clone --branch v5.1.2 https://github.com/iissnan/hexo-theme-next themes/next

Activate the theme in _config.yml

Open the main Hexo root config file, _config.yml, and set the theme field to next. Then generate and preview your site with Hexo as usual.

theme: next

Add a tags page and a categories page

To list all tags or categories, create a page with Hexo, set its type in the page's front matter, then add it to the menu in the theme's _config.yml. The README uses the names tags and categories for these pages.

  • Create a tags page, then set type to "tags" in the page file
  • Create a categories page, then set type to "categories" in the page file
  • Add the matching entries under menu in the theme _config.yml
$ hexo new page "tags" # in the tags page file: title: All tags type: "tags" # in theme _config.yml: menu: home: / archives: /archives tags: /tags

NexT has native support for DuoShuo and Disqus comments. Add the snippet for the system you use to _config.yml. For social links, list your account URLs under social. The language field sets the interface language; English is the default.

  • Comments: use either the duoshuo block or disqus_shortname
  • Social: GitHub, Twitter, Weibo, DouBan and ZhiHu fields are shown in the README
  • Language: set language to a code such as zh-Hans for Simplified Chinese
language: zh-Hans social: GitHub: your-github-url Twitter: your-twitter-url disqus_shortname: your-disqus-shortname

Keep your settings when you update

Updating with git pull can cause conflicts when your config changes. The README describes an approach that stores theme options in source/_data/next.yml, which requires Hexo 3 or above. You copy the options you use into that file and start Hexo with the --config flag pointing to it.

Before you pull updates, commit, stash or discard local changes in the theme folder, or git will refuse to merge.

  • Create source/_data (if missing) and a next.yml file in it
  • Copy the theme options you need into next.yml
  • Pass --config source/_data/next.yml to hexo commands
$ cd themes/next $ git pull $ hexo clean --config source/_data/next.yml && hexo g --config source/_data/next.yml

What people use it for

  • Running a personal blog with a clean, configurable look
  • Publishing a multilingual site using one of the supported languages
  • Adding Disqus or DuoShuo comments without writing custom code
  • Showing social media links in the site sidebar or menu

Frequently asked questions

Is hexo-theme-next still maintained?

No. The README says this original repository is no longer maintained and points to the community-maintained version at theme-next/hexo-theme-next, which covers NexT v6 and v7.

Is hexo-theme-next free to use?

The project is licensed under MIT, as listed on its repository page. Check the LICENSE file in the repository for the full terms.

What do I need before installing NexT?

You need an existing Hexo site, Node.js and npm for Hexo and its dependencies, and Git if you use the git clone method. The README also mentions Hexo 3 or above for the data-file feature.

Does NexT work without Hexo?

No. It is a theme for Hexo and only works inside a Hexo site.

Why do I get the error Cannot find module 'hexo-util'?

The README links this error to an issue about the npm version. With npm above 3, remove the node_modules directory and reinstall with npm install. With npm below 3, add hexo-util with npm install --save-dev hexo-util.

Which languages does NexT support?

The README lists Simplified and Traditional Chinese, English, Russian, French, German, Japanese, Indonesian, Portuguese (Brazil), Korean, Italian, Dutch and Vietnamese. English is the default.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

NexT suits bloggers who already use Hexo and want an attractive, configurable theme with built-in comments, social links and multiple languages. Because the original repository is no longer maintained, use the community fork at theme-next/hexo-theme-next, and pick another theme if you are not comfortable with the command line and Node.js.

Install options & downloads