Total Pageviews

Sunday, 22 March 2026

hexo-theme-next

 

Elegant theme for Hexo.

notes.iissnan.com

The community-maintained version is here: NexT v6 and v7 

NexT is a high quality elegant Hexo theme. It is crafted from scratch, with love.

gitter-image mnt-image travis-image rel-image hexo-image lic-image

Live Preview

More NexT examples here.

Installation

1. Change dir to hexo root directory. There must be node_modules, source, themes and other directories:

$ cd hexo
$ ls
_config.yml  node_modules  package.json  public  scaffolds  source  themes

2. Get theme from GitHub. There are several variants to do it:

At most cases stable. Recommended for most users.

curl-tar-wget-image

$ mkdir themes/next
$ curl -s https://api.github.com/repos/iissnan/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1

You must define version. Replace v5.1.2 with any version from tags list.

curl-tar-image

$ mkdir themes/next
$ curl -L https://api.github.com/repos/iissnan/hexo-theme-next/tarball/v5.1.2 | tar -zxv -C themes/next --strip-components=1

git-image

$ git clone --branch v5.1.2 https://github.com/iissnan/hexo-theme-next themes/next

May be unstable, but includes latest features. Recommended for developers.

curl-tar-image

$ mkdir themes/next
$ curl -L https://api.github.com/repos/iissnan/hexo-theme-next/tarball | tar -zxv -C themes/next --strip-components=1

git-image

$ git clone https://github.com/iissnan/hexo-theme-next themes/next

Clone command will give you the whole repository. And in any time you can switch to any tagged release.
Get tags list:

$ cd themes/next
$ git tag -l
…
v5.0.0
v5.0.1
v5.1.0
v5.1.1
v5.1.2

For example, you want to switch on v5.1.0 tagged release version. Input the following command:

$ git checkout tags/v5.1.0
Note: checking out 'tags/v5.1.0'.
…
HEAD now on 1f72f68... CSS: Remove global list-style setting of ul

And if you want to switch back on master branch, input this command:

$ git checkout master

3. Set theme in main hexo root config _config.yml file:

theme: next

Bugs

For those who also encounter Error: Cannot find module 'hexo-util' issue, please check your NPM version.

  • > 3: Still not work. Please remove node_modules directory and reinstall using npm install.
  • < 3: Please add hexo-util explicitly via npm install --save-dev hexo-util to you site package deps.

Update

$ cd themes/next
$ git pull

Bugs

Commit your changes or stash them before you can merge

You must Commit, Stash or Discard local changes. See here how to do it.

Theme configurations using Hexo data files (#328)

Currently, it is not smooth to update NexT theme from pulling or downloading new releases. It is quite often running into conflict status when updating NexT theme via git pull, or need to merge configurations manually when upgrading to new releases.

At present, NexT encourages users to store some options in site's _config.yml and other options in theme's _config.yml. This approach is applicable, but has some drawbacks:

  1. Configurations are splited into two pieces
  2. Users maybe confuse which place should be for options

In order to resolve this issue, NexT will take advantage of Hexo Data files. Because Data files is introduced in Hexo 3, so you need upgrade Hexo to 3.0 (or above) to use this feature.

If you prefer Hexo 2.x, you can still use the old approach for configurations. NexT is still compatible with Hexo 2.x.

Benefits

With this feature, now you can put all your configurations into one place (source/_data/next.yml), you don't need to touch next/_config.yml. If there are any new options in new releases, you just need to copy those options from next/_config.yml, paste into _data/next.yml and set their values to whatever you want.

How to use this feature

  1. Please ensure you are using Hexo 3 (or above)
  2. Create an file named next.yml in site's source/_data directory (create _data directory if it did not exist)
  3. Copy NexT theme options both in site's _config.yml and theme's _config.yml into next.yml.
  4. Use --config source/_data/next.yml parameter to start server, generate or deploy.
    For example: hexo clean --config source/_data/next.yml && hexo g --config source/_data/next.yml.

FROM  https://github.com/iissnan/hexo-theme-next

-------

相关帖子: https://briteming.blogspot.com/2013/06/linux-vps-hexo.html

No comments:

Post a Comment