NexT v6.0.0 here :triangular_flag_on_post:

NexT

NexT 是一个高质量并且优雅的Hexo 主题。这是精心制作做出来的 hexo 主题。

Join the chat at https://gitter.im/iissnan/hexo-theme-next
mnt-image
travis-image
rel-image
hexo-image
lic-image

实时预览 Live Preview

更多 NexT 例子点击 这里.

安装 Installation

1. 在终端切换到hexo 根目录. 在hexo目录下一定有 node_modules, source, themes 和其他文件夹:

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

2. 从 github 上获取主题 。这里有几种方式来获取主题:

下载最新发布的版本 Download tagged release version

在大多数情况下 稳定。 推荐用户下载这个。

curl-tar-wget-image

sh
$ 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

下载标签发布版本 Download tagged release version

您必须定义版本。从标签列表里选择版本替换v5.1.2

curl-tar-image

sh
$ 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

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

下载最新的 master 分支 Download latest master branch

可能会 不稳定, 但是包含最新的特色,推荐开发者下载.

curl-tar-image

sh
$ 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

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

使用克隆命令,你将得到整个存储库。而且在任何时候你都可以切换到任何标签发布版本。
获取标签列表:

sh
$ cd themes/next
$ git tag -l

v5.0.0
v5.0.1
v5.1.0
v5.1.1
v5.1.2

例如, 你想要切换到v5.1.0 标签发布版本. 输入以下命令:

sh
$ 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

如果你想切换回 master 分支的话, 输入这个命令:

sh
$ git checkout master

3.hexo 根目录下 的配置文件_config.yml里设置主题:

theme: next

Bugs

对于那些遇到 Error: Cannot find module ‘hexo-util’ 问题的人, 请检查你的NPM 版本.

更新 Update

sh
$ cd themes/next
$ git pull

Bugs

提交您的更改或存储它们,然后才能合并。

您必须提交,存储或放弃本地更改. 看 here 是如何做的。

使用Hexo data files(#328)配置主题 Theme configurations using Hexo data files #328

目前升级 NexT 主题的时候并不是非常的流畅。若使用 git pull 的方式,很多时候可能会产生冲突;而下载新版本覆盖安装的方式又需要手动合并主题的 _config.yml 文件。

在此修改之前, NexT 建议将配置分离,一部分在 站点的配置文件中,另外一部分在主题的配置文件中。将需要自定的选项放置在 站点配置文件中,从而脱离避免更新主题时可能遇到的麻烦。这种方式是可行,但是有一些缺点:

  1. 配置分离成了两个部分
  2. 用户可能会疑惑一些选项该放置在哪里比较合适

为了解决这个问题, NexT 将会使用 Hexo 的 Data Files 。然而由于 Data Files 是在 Hexo 3 版本时引进的,所以要使用这个特性,需要 Hexo 的版本不低于 3。

若你比较喜欢 Hexo 2.x 版本,可以继续使用原先的配置方式。 NexT 保持着向下兼容。

特性 Benefits

通过这个特性,你可以将所有的主题配置放置在站点的 source/_data/next.yml 文件中。原先放置在 站点配置文件 中的选项可以迁移到新的位置,同时,主题配置文件可以不用做任何修改。若后续版本有配置相关的改动时,你仅需在 next.yml 中做相应调整即可

如何使用这个特性 How to use this feature

  1. 请先确保你所使用的 Hexo 版本在 3 以上
  2. 在站点的 source/_data 目录下新建 next.yml 文件(_data目录可能需要新建)
  3. 迁移站点配置文件和主题配置文件中的配置到 next.yml
  4. 使用 --config source/_data/next.yml 参数启动服务器, 生成或者部署。
    例如: hexo clean --config source/_data/next.yml && hexo g --config source/_data/next.yml

特色 Features

支持多国语言, 包括:

:cn: 简体中文 & 繁体中文

:us: 英语

:ru: 俄语

:fr: 法语

:de: 德语

:jp: 日语

:indonesia: 印度尼西亚语

:portugal: 葡萄牙语 (巴西)

:kr: 朝鲜语

:it: 意大利语

:netherlands: 荷兰语

默认语言是英语。

yml
language: en
# language: zh-Hans
# language: zh-hk
# language: zh-tw
# language: ru
# language: fr-FR
# language: de
# language: ja
# language: id
# language: pt
# language: pt-BR
# language: ko
# language: it
# language: nl-NL

在站点配置文件_config.yml中可以将语言切换成中文

yml
language: zh-Hans

评论支持 Comment support

NexT 已经原生支持 多说 and Disqus 评论系统。

添加以下代码到你的主题配置文件 _config.yml:

yml
duoshuo:
enable: true
shortname: your-duoshuo-shortname

或者

yml
disqus_shortname: your-disqus-shortname

标签页 Tags page

添加一个标签页面,里面包含您网站中的所有标签。

分类页 Categories page

添加一个分类页面,里面包含您网站中的所有分类。

社交媒体 Social Media

NexT 可以自动添加链接到您的社交媒体帐户里:

yml
social:
GitHub: your-github-url
Twitter: your-twitter-url
Weibo: your-weibo-url
DouBan: your-douban-url
ZhiHu: your-zhihu-url

显示 feed 链接。

在主题配置文件_config.yml里设置rss , 如下所示:

  1. rss: false 会禁用 feed 链接。

  2. rss: 使用站点 feed 链接。这是默认的选项。

    按照插件hexo-generator-feed的README中的安装说明进行操作。在完成这个插件的配置后,Feed链接也生成好了

  3. rss: http://your-feed-url 设置你的 feed 链接.

内置5种代码高亮主题 Up to 5 code highlight themes built-in

NexT 使用的是 Tomorrow 主题 ,一共有5种主题供你选择。
Next 默认使用 normal. 下面是 normalnight 主题的预览:

Tomorrow Normal Preview
Tomorrow Night Preview

查看更多信息点击Tomorrow 主题

配置 Configuration

NexT 的配置很少

yml

# Menu configuration.
menu:
home: /
archives: /archives

# Favicon
favicon: /favicon.ico

# Avatar (put the image into next/source/images/)
# can be any image format supported by web browsers (JPEG,PNG,GIF,SVG,..)
avatar: /default_avatar.png

# Code highlight theme
# available: normal | night | night eighties | night blue | night bright
highlight_theme: normal

# Fancybox for image gallery
fancybox: true

# Specify the date when the site was setup
since: 2013

浏览器支持 Browser support

Browser support

Browser Stack

BrowserStack is a cloud-based cross-browser testing tool that enables developers to test their websites across various browsers on different operating systems and mobile devices, without requiring users to install virtual machines, devices or emulators.

贡献 Contributing

接受各种形式的贡献,包括不限于提交问题与需求,修复代码。等待您的Pull Request

Any types of contribution are welcome. Thanks.

ATTENTION! Contributors on Chinese docs needed!
Need to translate from English docs to Chinese docs.
Any help wanted!
Thank’s a lot!

开发 Development

NexT 主旨在于简洁优雅且易于使用,所以首先要尽量确保 NexT 的简洁易用性。

NexT is built for easily use with elegant appearance. First things first, always keep things simple.

开发历史 Changelog