A set of basic page generators for Hexo, with multi-language supported. Includes variant of modules below:
- Individual webpages in expected url.
- Pagination by languages.
$ npm install hexo-generator-basic-set --save
- Change your settings in
_config.yml
- Set
languages
. - Start your
new_post_name
with:lang/
- Start your
permalink
with:lang/
- Create your new post using
hexo new <layout> <title> --lang <your language>
Note: It's not recommended to use date as a part of permalink
, for you may write a post in two language in different date, change only the language part in url doesn't help you make a correct switch.
Each generator has its own configuration(like its original version). The configurations are listed below:
# Pagination
## Set per_page to 0 to disable pagination
pagination_dir: page
## This parameter is used as default value
## if "per_page" is not presented in the respective configuration
per_page: 4
index_generator:
per_page: 5
order_by: -date
archive_generator:
per_page: 3
yearly: true
monthly: true
daily: false
category_generator:
per_page: 5
tag_generator:
per_page: 5
enable_index_page: false
Generators can be easily disabled by removing the corresponding configurations from _config.yml
.
Note: No sub-folders will be created if you leave languages
unfilled or just assign one language, an index.html will be generated under public/
, just like the original one does. Config in this way if you don't want a multi-language blog.
- Not compatible with the original plugins.
- No webpage of index/archive/category/tag's pagination will be generated if there is no post of corresponding language, even if you have declared that language in
_config.yml
. - Tag/Category itself doesn't have a translation.
MIT
Thanks to tommy351's original works.