diff --git a/docs/cn/DATA-FILES.md b/docs/cn/DATA-FILES.md index 7443f04227..2aff8df629 100644 --- a/docs/cn/DATA-FILES.md +++ b/docs/cn/DATA-FILES.md @@ -1,5 +1,23 @@ -
从 GitHub 下载主题。 +为了下载这一主题,共有 3 种选项可选。你需要选择其中唯一一个方式。
+ +### 选项 1:下载[最新 release 版本][releases-latest-url] + + 通常情况下请选择 **stable** 版本。推荐不熟悉的用户按此方式进行。 + + * 使用 [curl、tar 和 wget][curl-tar-wget-url] 安装: + + ```sh + $ mkdir themes/next + $ curl -s https://api.github.com/repos/theme-next/hexo-theme-next/releases/latest | grep tarball_url | cut -d '"' -f 4 | wget -i - -O- | tar -zx -C themes/next --strip-components=1 + ``` + 这种方式将**仅提供最新的 release 版本**(其中不附带 `.git` 目录)。\ + 因此,将来你将不可能通过 `git` 更新这一方式安装的主题。\ + 取而代之的,为了能不丢失你的自定义配置,你可以使用独立的配置文件(例如 [数据文件][docs-data-files-url])并下载最新版本到旧版本的目录中(或者下载到新的主题目录中并修改 Hexo 配置中的主题名)。 + +### 选项 2:下载 [tag 指向的 release 版本][releases-url] + + 在少数情况下将有所帮助,但这并非推荐方式。\ + 你必须指定一个版本:使用 [tags 列表][tags-url]中的任意 tag 替换 `v6.0.0`。 + + * 方式 1:使用 [curl 和 tar][curl-tar-url] 安装: + + ```sh + $ mkdir themes/next + $ curl -L https://api.github.com/repos/theme-next/hexo-theme-next/tarball/v6.0.0 | tar -zxv -C themes/next --strip-components=1 + ``` + 和上述的 `curl、tar 和 wget` 方法相同,但只会下载**指定的 release 版本**。 + + * 方式 2:使用 [git][git-url] 安装: + + ```sh + $ git clone --branch v6.0.0 https://github.com/theme-next/hexo-theme-next themes/next + ``` + 这一方式将为你下载**指定的 release 版本**(其中包含 `.git` 目录)。\ + 并且,你可以随时切换到任何已定义的版本号所对应的 tag 的版本。 + +### 选项 3:下载[最新 master 分支][download-latest-url] + + 可能**不稳定**,但包含最新的特性。推荐进阶用户和开发者按此方式进行。 + + * 方式 1:使用 [curl 和 tar][curl-tar-url] 安装: + + ```sh + $ mkdir themes/next + $ curl -L https://api.github.com/repos/theme-next/hexo-theme-next/tarball | tar -zxv -C themes/next --strip-components=1 + ``` + 和上述的 `curl、tar 和 wget` 方法相同,但只会下载**最新 master 分支版本**。\ + 在有些情况对开发者有所帮助。 + + * 方式 2:使用 [git][git-url] 安装: + + ```sh + $ git clone https://github.com/theme-next/hexo-theme-next themes/next + ``` + + 这一方式将为你下载**完整仓库**(其中包含 `.git` 目录)。\ + 你可以随时[使用 git 更新至最新版本][update-with-git-url]并切换至任何有 tag 标记的 release 版本、最新的 master 分支版本、甚至其他分支。\ + 在绝大多数情况下对用户和开发者友好。 + + 获取 tags 列表: + + ```sh + $ cd themes/next + $ git tag -l + … + v6.0.0 + v6.0.1 + v6.0.2 + ``` + + 例如,假设你想要切换到 `v6.0.1` 这一 [tag 指向的 release 版本][tags-url]。输入如下指令: + + ```sh + $ git checkout tags/v6.0.1 + Note: checking out 'tags/v6.0.1'. + … + HEAD now on 1f72f68... CSS: Remove global list-style setting of ul + ``` + + 然后,假设你想要切换回 [master 分支][commits-url],输入如下指令即可: + + ```sh + $ git checkout master + ``` + +«NexT» 是一款风格优雅的高质量 Hexo 主题,自点点滴滴中用爱雕琢而成。
+ +[![gitter-image]][gitter-url] +[![mnt-image]][commits-url] +[![travis-image]][travis-url] +[![rel-image]][releases-url] +[![hexo-image]][hexo-url] +[![lic-image]][lic-url] + +* :triangular_flag_on_post: 推荐 Markdown 编辑器:HexoEditor + +## 即时预览 + +* :heart_decoration: Muse 主题: [XiaMo](https://notes.wanghao.work) | [OAwan](https://oawan.me) | [Hui Wang](http://hui-wang.info) +* :six_pointed_star: Mist 主题: [Jeff](https://blog.zzbd.org) | [uchuhimo](http://uchuhimo.me) | [xirong](http://www.ixirong.com) +* :pisces: Pisces 主题: [Vi](http://notes.iissnan.com) | [Acris](https://acris.me) | [Rainy](https://rainylog.com) +* :gemini: Gemini 主题: [Ivan.Nginx](https://almostover.ru) | [Alynx](http://sh.alynx.xyz) | [Raincal](https://raincal.top) + +更多 «NexT» 的例子参见[这里](https://github.com/iissnan/hexo-theme-next/issues/119)。 + +## 安装 + +最简单的安装方式是直接克隆整个仓库: + + ```sh + $ cd hexo + $ git clone https://github.com/theme-next/hexo-theme-next themes/next + ``` + +此外,如果你想要使用其他方式,你也可以参见[详细安装步骤][docs-installation-url]。 + +## 更新 + +你可以通过如下命令更新到最新的 master 分支: + +```sh +$ cd themes/next +$ git pull +``` + +如果你在此过程中收到了任何错误报告 (例如 **«Commit your changes or stash them before you can merge»**),我们推荐你使用 [Hexo 数据文件][docs-data-files-url]特性。\ +然而你也可以通过提交(`Commit`)、贮藏(`Stash`)或忽视(`Discard`)本地更改以绕过这种更新错误。具体方法请参考[这里](https://stackoverflow.com/a/15745424/5861495)。 + +如果你想要从 v5.1.x 更新到 v6.0.x,阅读[这篇文档][docs-update-5-1-x-url]。 + +## 已知问题 + +对于仍然遇到 **«[Error: Cannot find module 'hexo-util'](https://github.com/iissnan/hexo-theme-next/issues/1490)»** 这一错误的用户,请检查你的 NPM 版本。 + +* `> 3`:仍然出现错误吗?请删除 `node_modules` 目录并通过 `npm install` 重新安装。 +* `< 3`:请通过 `npm install --save-dev hexo-util` 将 `hexo-util` 依赖手动添加至你的站点依赖包中。 + +## 贡献你的代码 + +我们欢迎你贡献出你的一份力量,你可以随时提交 issue 或 fork 本仓库。静候你的 pull request。 + +[browser-image]: https://img.shields.io/badge/browser-%20chrome%20%7C%20firefox%20%7C%20opera%20%7C%20safari%20%7C%20ie%20%3E%3D%209-lightgrey.svg +[browser-url]: https://www.browserstack.com + +[gitter-image]: https://badges.gitter.im/Join%20Chat.svg +[gitter-url]: https://gitter.im/theme-next + +[travis-image]: https://travis-ci.org/theme-next/hexo-theme-next.svg?branch=master +[travis-url]: https://travis-ci.org/theme-next/hexo-theme-next?branch=master "Travis CI" + +[hexo-image]: https://img.shields.io/badge/hexo-%3E%3D%203.0-blue.svg +[hexo-url]: http://hexo.io + +[lic-image]: https://img.shields.io/badge/license-%20AGPL-blue.svg +[lic-url]: https://github.com/theme-next/hexo-theme-next/blob/master/LICENSE.md + +[rel-image]: https://img.shields.io/github/release/theme-next/hexo-theme-next.svg +[mnt-image]: https://img.shields.io/maintenance/yes/2018.svg + +[download-latest-url]: https://github.com/theme-next/hexo-theme-next/archive/master.zip +[releases-latest-url]: https://github.com/theme-next/hexo-theme-next/releases/latest +[releases-url]: https://github.com/theme-next/hexo-theme-next/releases +[tags-url]: https://github.com/theme-next/hexo-theme-next/tags +[commits-url]: https://github.com/theme-next/hexo-theme-next/commits/master + +[docs-installation-url]: https://github.com/theme-next/hexo-theme-next/blob/master/docs/cn/INSTALLATION.md +[docs-data-files-url]: https://github.com/theme-next/hexo-theme-next/blob/master/docs/cn/DATA-FILES.md +[docs-update-5-1-x-url]: https://github.com/theme-next/hexo-theme-next/blob/master/docs/cn/UPDATE-FROM-5.1.X.md diff --git a/docs/cn/UPDATE-FROM-5.1.X.md b/docs/cn/UPDATE-FROM-5.1.X.md new file mode 100644 index 0000000000..8b561a094e --- /dev/null +++ b/docs/cn/UPDATE-FROM-5.1.X.md @@ -0,0 +1,29 @@ +