概览:
主题
Scheme 是 NexT 提供的一种特性,借助于 Scheme,NexT 为你提供多种不同的外观。同时,几乎所有的配置都可以 在 Scheme 之间共用。目前 NexT 支持三种 Scheme,他们是:
- Muse - 默认 Scheme,这是 NexT 最初的版本,黑白主调,大量留白
- Mist - Muse 的紧凑版本,整洁有序的单栏外观
- Pisces - 双栏 Scheme,小家碧玉似的清新
Scheme 的切换通过更改 主题配置文件,搜索 scheme 关键字。 你会看到有三行 scheme 的配置,将你需用启用的 scheme 前面注释 # 去除即可。
选择 Pisces Scheme
1 | #scheme: Muse |
语言
编辑 站点配置文件, 将 language 设置成你所需要的语言。建议明确设置你所需要的语言,例如选用简体中文,配置如下:
1 | language: zh-CN |
目前 NexT 支持的语言如以下表格所示:
语言 | 代码 | 设定示例 |
---|---|---|
English | en | language: en |
简体中文 | zh-CN | language: zh-CN |
Français | fr-FR | language: fr-FR |
Português | pt | language: pt or language: pt-BR |
Русский язык | ru | language: ru |
Deutsch | de | language: de |
日本語 | ja | language: ja |
Indonesian | id | language: id |
Korean | ko | language: ko |
菜单
菜单配置包括三个部分,第一是菜单项(名称和链接),第二是菜单项的显示文本,第三是菜单项对应的图标。 NexT 使用的是 Font Awesome 提供的图标, Font Awesome 提供了 600+ 的图标,可以满足绝大的多数的场景,同时无须担心在 Retina 屏幕下 图标模糊的问题。
编辑 主题配置文件,修改以下内容:
1.设定菜单内容,对应的字段是 menu。 菜单内容的设置格式是:item name: link。其中 item name 是一个名称,这个名称并不直接显示在页面上,她将用于匹配图标以及翻译。
菜单示例配置
1 | # --------------------------------------------------------------- |
NexT 默认的菜单项有(标注 的项表示需要手动创建这个页面):
键值 | 设定值 | 显示文本(简体中文) |
---|---|---|
home | home: / | 主页 |
archives | archives: /archives | 归档页 |
categories | categories: /categories | 分类页 |
tags | tags: /tags | 标签页 |
about | about: /about | 关于页面 |
commonweal | commonweal: /404.html | 公益 404 |
1 | hexo new page 'tags' #创建tags子目录 |
分别修改这tags和categories文件夹中的index.md文件,新增type属性,如下:
1 | --- |
categories的修改类似。
当你新建一篇博文的时候,增加上tags和categories属性值,就能在tags和categories界面检索到你的文章了。
头像
编辑 主题配置文件, 修改字段 avatar, 值设置成头像的链接地址。其中,头像的链接地址可以是:
地址 | 值 |
---|---|
完整的互联网 URI | http://example.com/avatar.png |
站点内的地址 | 放置在 |
作者昵称
编辑 站点配置文件, 设置 author 为你的昵称。
打开\themes\next\source\css\_common\components\sidebar\sidebar-author.styl,在里面添加如下代码:
1 | .site-author-image { |
站点描述
编辑 站点配置文件, 设置 description 字段为你的站点描述。站点描述可以是你喜欢的一句签名:)
主页显示文章摘要
编辑 站点配置文件,设置per_page字段
1 | per_page: 10 |
那么每页显示10篇文章,这样的话主页就看起来不是很精简了,可以通过下面的方法来配置主页只显示文章摘要:
在主题配置文件中配置:把enable项配置为true就可以了。
1 | # Automatically Excerpt. Not recommand. |
但是我们也可以看到注释中是不推荐这样做的,因为这样会强制把文章前150个字符做为摘要的,会出现描述不完整的情况,而且有时候会把文章的源码显示出来。
那么我们就用推荐的在文章中用<!-- more –>
这种方式来作为文章摘要的方式,可以根据每篇文章的不同情况自己来把控摘要的内容。