3

一款基于 webstack 的 hexo 主题

 2 years ago
source link: https://blog.hclonely.com/posts/3cd4fb34/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

一款基于 webstack 的 hexo 主题

一款基于WebStackPage的 Hexo 主题。Demo

screenshot
screenshot
fc2ec5 , 1 commits behind
18 commits
fc2ec5, referenced in this article
c7314b, latest
Shell

favicon

banner

[可选]分享网站到 twitter 和 facebook 时的图片。

网站 logo

  • expanded: 侧边栏展开时左上角的 logo
    expanded
    expanded
  • collapsed: 侧边栏收起时左上角的 logo
    collapsed
    collapsed
  • dark: 顶栏为暗色时左上角的 logo, 仅about页面生效
    dark
    dark

语言标识,多语言请配合子页面使用

  • icon: 语言图标,默认仅有flag-cnflag-us, 其他图标自行寻找存放于主题目录/source/images/flags/
  • name: 语言名称
  • default: 该语言是否为默认语言
  • index: 页面链接

flag
flag

search

是否显示搜索框

userDefinedSearchData

自定义搜索引擎

  • custom: 是否启用自定义配置
  • thisSearch: 当前搜索引擎的搜索链接
  • thisSearchIcon: 当前搜索引擎的图标链接,格式为url(图片链接)
  • hotStatus: 是否启用搜热词功能
  • data: 多搜索引擎配置
    • name: 搜索引擎名字
      img: 搜索引擎的搜索链接
      url: 搜索引擎的图标链接,格式为url(图片链接)

githubCorner

右上角的github corner

github
github

since

建站年份,显示在页面底部

since
since

[主要]侧边栏菜单设置

  • name: 分组名
  • icon: 分组图标
  • config: [主要]分组内容(详细设置查看Config),如果有二级菜单则不需要此项!
  • submenu: 二级菜单,如果有二级菜单则不需要config, 此选项内容包含name,icon,config选项

menu
menu

expandAll

是否将侧边栏全部展开

about

侧边栏的关于本站

  • url: 关于页面链接
  • name: 在侧边栏显示的文字
  • icon: 图标

about
about

aboutPage

关于页面设置

  1. 生成关于页面
Shell
  1. 编辑source/about/index.md, 添加type: 'about'
  1. 编辑主题配置文件的aboutPage
  • website: 关于本站内容
    • head: 标题
    • html: 内容,支持html语法
  • webmaster: 关于站长内容
    • head: 标题
    • name: 站长名字
    • url: 链接
    • img: 头像
    • description: 描述
    • html: 其他内容,支持html语法

aboutPage
aboutPage

busuanzi

不蒜子统计

  • enable: 是否启用不蒜子统计
  • position: 访问量显示位置,footer显示在页脚,sidebar显示在侧边栏
  • pv: 访问量显示的内容,$pv会被替换为访问量
  • uv: 访客数显示的内容,$uv会被替换为访客数

sidebarsidebar
footerfooter

custom

自定义html内容

  • head: 插入到<head></head>标签内的内容
  • body: 插入到</body>标签之前的内容

config

[主要]网站内容设置

  • name: 网站名称
  • url: 网站链接
  • img: 网站图标
  • description: 网站描述

关联设置名称并添加网站

menusubmenu中设置的config的内容为此选项的名称。

menu

常用工具分组里的网站有以下两种添加方式:

  • 在主题的_config.yml里添加:
  • 站点根目录/source/_data/(没有自行创建)内新建hotTools.yml文件,文件内容如下:

以上两种方式任选一种即可,建议使用第二种。

子页面配置

创建子页面

使用hexo new page xxx创建子页面,这里包括下面的说明都以hexo new page child为例。

修改子页面配置文件

使用上面的命令生成子页面后,打开根目录/source/child/index.md文件(子页面配置文件),在两个---之间添加一行type: 'child'使此配置文件生效,子页面默认使用主页的配置,子页面优先使用子页面配置文件两个---之间的配置,各配置项和主页的配置功能相同。

示例请看https://github.com/HCLonely/hexo-theme-webstack/tree/gh-pages/source/child/index.md

由于子页面在很久之前就基本做完了,后来比较忙就鸽了,可能有些配置或 bug 给忘了,有问题请及时反馈!


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK