NexT是一个优雅的Hexo主题,主题作者很努力,NexT已经很完善了,现在版本是5.1.0。我这里只记录下简单的安装,和使用中遇到的问题。
安装
在站点根目录执行以下命令:
git clone https://github.com/iissnan/hexo-theme-next themes/next
启用
打开站点配置文件,就是根目录下的 _config.yml
文件。
修改 theme: next
现在就可以在本地预览了。
设置其它外观
打开主题配置文件,就是next主题目录下的 _config.yml
文件。
修改 Schemes
下的其它设置。
#scheme: Muse
#scheme: Mist
scheme: Pisces
设置中文
打开站点配置文件,修改 language: zh-Hans
好了,简单的安装设置到这里。
更详细的设置请移步:NexT 使用文档
常见问题:
常见问题 - NexT 使用文档
iissnan/hexo-theme-next/issues
其它问题:
修改每个页面的浏览器的titile
默认的titile是站点配置文件参数Site的title值。
打开your-hexo-site\themes\next\layout\index.swig
修改 {% block title %} {{ config.title }} {% endblock %}
为
{% block title %} {{ config.title }} | {{ theme.description }} {% endblock %}
这样设置首页和归档页生效。
修改其它新建的页面,如:分类页、标签页等
打开your-hexo-site\themes\next\layout\page.swig
找到这段代码
{% block title %}
{% set page_title_suffix = ' | ' + config.title %}
{% if page.type === "categories" and not page.title %}
{{ __('title.category') + page_title_suffix }}
{% elif page.type === "tags" and not page.title %}
{{ __('title.tag') + page_title_suffix }}
{% else %}
{{ page.title + page_title_suffix }}
{% endif %}
{% endblock %}
修改为
{% block title %}
{% set page_title_suffix = ' | ' + config.title + ' - ' + theme.description %}
{% if page.type === "categories" %}
{{ __('title.category') + page_title_suffix }}
{% elif page.type === "tags" %}
{{ __('title.tag') + page_title_suffix }}
{% else %}
{{ page.title + page_title_suffix }}
{% endif %}
{% endblock %}
然后修改 your-hexo-site\source\categories
的 type: "categories"
,注释掉原有的 title
。
其它新建页面也对应修改。
最后别忘了修改 your-hexo-site\themes\next\languages
中的 zh-Hans.yml
title:
archive: 归档
category: 分类
tag: 标签
这样,所有的title就修改完了。
网友评论