This theme was forked from hexo-theme-oranges (English | 简体中文).
- Original existing functions from hexo-theme-oranges
- Support the publication of articles in multiple languages
- Add switch-language icon in the lower right corner
- Support accessing url with context path suffix
- Enter hexo root directory and download theme via git submodule.
git submodule add -b multilang https://github.com/sissilab/hexo-theme-arch.git themes/arch
To update the theme in the future, just execute the git pull
command in the theme root directory.
- Remove
hexo-generator-*
and addhexo-pagination
frompackage.json
.
npm uninstall hexo-generator-archive
npm uninstall hexo-generator-category
npm uninstall hexo-generator-index
npm uninstall hexo-generator-tag
npm install hexo-pagination --save
- Activate theme.
_config.yml
can refer to hexo-theme-arch-sample.
# Set theme to arch in _config.yml
theme: arch
- Configure theme.
Copy the _config.yml
file in the theme folder to the blog root directory and rename it to _config.arch.yml
.
_config.arch.yml
can refer to hexo-theme-arch-sample.
If you want to support the publication of articles in both English (en) and Simplified Chinese (zh-CN), you can consider the following steps:
- Please find complete sample configuration in hexo-theme-arch-sample.
- Accessing http://localhost:4000/hexo-theme-arch-sample/ will redirect to http://localhost:4000/hexo-theme-arch-sample/en/ (as
en
is located in the 1st position oflanguage: [en, zh-CN]
)- English site: http://localhost:4000/hexo-theme-arch-sample/en/
- Simplified Chinese site: http://localhost:4000/hexo-theme-arch-sample/zh-CN/
- Firstly follow the above Usage to complete download and configuration of the theme.
- Set
language: [en, zh-CN]
in_config.yml
. - Enable navigation bar in
_config.arch.yml
. If you enableCategories
,Tags
,About
orFriends
, you need create the corresponding files: a. EnableCategories
: Createsource/en/categories/index.md
with the following content:Create--- title: categories type: "categories" lang: en ---
source/zh-CN/categories/index.md
with the following content:b. Enable--- title: categories type: "categories" lang: zh-CN ---
Tags
: Createsource/en/tags/index.md
with the following content:Create--- title: tags type: "tags" lang: en ---
source/zh-CN/tags/index.md
with the following content:c. Enable--- title: tags type: "tags" lang: zh-CN ---
About
: Createsource/en/about/index.md
with the following content:Create--- title: about type: "about" lang: en --- Introduce yourself here!
source/zh-CN/about/index.md
with the following content:d. Enable--- title: about type: "about" lang: zh-CN --- 在这里介绍你自己吧!
Friends
: Createsource/en/friends/index.md
with the following content:Create--- title: friends type: "friends" lang: en ---
source/zh-CN/friends/index.md
with the following content:--- title: friends type: "friends" lang: zh-CN ---
- Add
post-en.md
andpost-zh-CN.md
underscaffolds
folder.post-en.md
content:
--- title: {{ title }} lang: en date: {{ date }} tags: [] categories: ---
post-zh-CN.md
content:
--- title: {{ title }} lang: zh-CN date: {{ date }} tags: [] categories: ---
- Now you can create your posts based on the templates defined under
scaffolds
folder. If you want to create a post in both English version and Simplified Chinese version, you need run commands as follows:- Create a new post in English version:
hexo new post-en --path en/hello "Hello"
- Create a new post in Simplified Chinese version:
hexo new post-zh --path zh-CN/hello "Hello"
- Create a new post in English version:
- Finally start your hexo service:
hexo s --debug
.