增加配置

1.添加右上角github

文件themes/next/layout/_layout.swig

这里有样例GitHub Corners (tholman.com)

更改your-url为你的github地址

1
2
//在<div class="headband"></div>下面
<a href="https://your-url" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#FD6C6C; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

2.设置背景动态

各个版本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
5.1.4
# Canvas-nest
canvas_nest: true

# three_waves
three_waves: false

# canvas_lines
canvas_lines: false

# canvas_sphere
canvas_sphere: false
7.8(按照提示git下载资源才能使用)
canvas_nest:
enable: true
onmobile: true # display on mobile or not
color: "0,0,255" # RGB values, use ',' to separate
opacity: 0.5 # the opacity of line: 0~1
zIndex: -1 # z-index property of the background
count: 99 # the number of lines
three:
enable: true
three_waves: false
canvas_lines: false
canvas_sphere: false
canvas_ribbon:
enable: false
size: 300 # The width of the ribbon
alpha: 0.6 # The transparency of the ribbon
zIndex: -1 # The display level of the ribbon
8.6.1
canvas_ribbon:
enable: true
size: 300 # The width of the ribbon 功能区的宽度
alpha: 0.6 # The transparency of the ribbon 色带的透明度
zIndex: -1 # The display level of the ribbon 功能区的显示级别
阅读全文 »

插件hexo-generator-search

安装

1
npm install hexo-generator-search --save

配置

_config.yml文件中配置

1
2
3
search:
path: search.xml
field: post

使用

页面增加了搜索的按钮

阅读全文 »

大意了,没有闪

问题:找到的那个next是老版本的v5.1.4

现在2021年7月26日已经到了v7.8了

基本一个月一更新

我特么

我特么想哭,:😢

妈妈,救我

救救我,救救我

1
2
3
4
5
目前在 GitHub 上面有三个 NexT 主题的仓库,一个是 v6.0.0 之前版本的个人仓库。因为主题原作者停止维护该主题,所以有高人另起炉灶,单独创立了一个名为 theme-next 的团队,v6.0.0 至 v7.8.0 版本主题在这个仓库中。然而,因 theme-next 团队管理者自 2019 年 10 月起长期不在线,管理者也没有给其他成员足够的权限,导致仓库管理出现很多问题,所以自 2020 年 5 月起,theme-next 团队部分成员迁移至 next-theme,新团队开发的 NexT 版本为 v8.0.0 版本。因此目前 NexT 主题共有三个仓库:

2014-2017:https://github.com/iissnan/hexo-theme-next
2018-2019:https://github.com/theme-next/hexo-theme-next
2020:https://github.com/next-theme/hexo-theme-next
阅读全文 »

yaml语法

1.yaml介绍

  • YAML:“Yet Another Markup Language”(仍是一种标记语言),不是以标记语法为重心,是以数据为中心。
  • YAML是一个可读性高,易于理解,用来表达数据序列化的格式。
  • 语法和其他高级语言类似,并且可以简单表达清单(数组)、散列表,标量等数据形态。
  • 使用空白符号缩进和大量依赖外观的特色,特别适合用来表达或编辑数据结构、各种配置文件等。
  • YAML的配置文件后缀为 .yml

2.基本语法

YAML使用可打印的Unicode字符,可使用UTF-8或UTF-16。

  • 数据结构采用键值对的形式,即 键名称: 值,注意冒号后面要有空格。

  • 每个清单(数组)成员以单行表示,并用短杠+空白(- )起始。或使用方括号([]),并用逗号+空白(, )分开成员。

  • 每个散列表的成员用冒号+空白(: )分开键值和内容。或使用大括号({ }),并用逗号+空白(, )分开。

  • 字符串值一般不使用引号,必要时可使用,使用双引号表示字符串时,会转义字符串中的特殊字符(例如\n)。使用单引号时不会转义字符串中的特殊字符。

  • 大小写敏感

  • 使用缩进表示层级关系,缩进不允许使用tab,只允许空格,因为有可能在不同系统下tab长度不一样

  • 缩进的空格数可以任意,只要相同层级的元素左对齐即可

  • 在单一文件中,可用连续三个连字号(—)区分多个文件。还有选择性的连续三个点号(…)用来表示文件结尾。

  • ‘#’表示注释,可以出现在一行中的任何位置,单行注释

  • 在使用逗号及冒号时,后面都必须接一个空白字符,所以可以在字符串或数值中自由加入分隔符号(例如:5,280或http://www.wikipedia.org)而不需要使用引号。

3.数据类型

  • 纯量(scalars):单个的、不可再分的值
  • 对象:键值对的集合,又称为映射(mapping)/ 哈希(hashes) / 字典(dictionary)
  • 数组:一组按次序排列的值,又称为序列(sequence) / 列表(list)

3.1.标量

阅读全文 »

新版本废弃

配置更新时间 updated(适用于5.1.4)

1.修改/themes/next/layout/_macro/post.swig文件

1
2
3
4
5
6
7
8
9
<!-- 在`<span class="post-time">...</span>添加 -->
{%if post.updated and post.updated > post.date%}
<span class="post-updated">
&nbsp; | &nbsp; {{ __('post.updated') }}
<time itemprop="dateUpdated" datetime="{{ moment(post.updated).format() }}" content="{{ date(post.updated, config.date_format) }}">
{{ date(post.updated, config.date_format) }}
</time>
</span>
{% endif %}

2.在模板中添加updated

启动服务器,就可以看见更新时间(文件最后修改时间)

配置到这里打住

阅读全文 »

插件TOC目录

安装

npm install hexo-toc –save

配置

_config.yml中添加

1
2
toc:  
maxDepth: 3

maxDepth 表示目录深度为3,即最多生成三级目录。

官方文档

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
toc:
maxdepth: 3
class: toc
slugify: transliteration
decodeEntities: false
anchor:
position: after
symbol: '#'
style: header-anchor
maxdepth: Use headings whose depth is at most maxdepth.
class: The CSS Class for the toc. (Default is false)
slugify: Choose which slugify function you want to use. Currently support uslug (Default) and transliteration.
decodeEntities: Select whether to enable decode entities. ( Default is false and please see #15).
anchor: Whether should have an anchor for each headings. (Default is false)
position: Where should the anchor be, before the title, or after the title. (Default is after);
symbol: Which symbol you want the anchor be. (Default is #);
style: The CSS class for the anchor, (Default is header-anchor);
阅读全文 »

配置

参考开始使用 - NexT 使用文档 (iissnan.com)

1.scheme

  • Muse - 默认 Scheme,这是 NexT 最初的版本,黑白主调,大量留白
  • Mist - Muse 的紧凑版本,整洁有序的单栏外观
  • Pisces - 双栏 Scheme,小家碧玉似的清新

修改主题文件夹下_config.yml文件

1
2
3
4
5
6
7
8
9
# Schemes
#在中间竖排的样式
#scheme: Muse
#在中间横排的样式
#scheme: Mist
#在左侧竖排的样式
#scheme: Pisces
#在左侧竖排的样式,比上一个大
scheme: Gemini

2.作者名字

在主题文件夹下_config.yml文件添加

1
2
author: 
description: ' '
阅读全文 »

主题next–请先阅读2.3的内容

安装

在根目录执行

1
git clone https://github.com/iissnan/hexo-theme-next.git themes/next

官方文档NexT 使用文档 (iissnan.com)

官方安装使用

1
git clone https://github.com/iissnan/hexo-theme-next themes/next

我没成功,去了github看了一下,最近更新是在三年前

妈的,这个有问题

阅读全文 »

新建分类

新建分类 categories 页

1
hexo new page "categories"

用来展示所有分类的页面

/source/categories/index.md

1
2
3
4
5
6
---
title: categories
date: 2020-05-13 22:06:28
type: "categories"
layout: "categories"
---

新建标签 tags 页

1
hexo new page "tags"

用来展示所有标签的页面

阅读全文 »

插件hexo-filter-github-emojis

安装

1
npm install hexo-filter-github-emojis --save

配置

_config.yml文件中配置

1
2
3
4
5
6
githubEmojis:
enable: true
className: github-emoji
inject: true
styles:
customEmojis:

使用

把对应的markdown emoji语法(::,例如::smile:)转变成会emoji表情

😄

阅读全文 »

插件hexo-permalink-pinyin

安装

1
npm i hexo-permalink-pinyin --save

配置

_config.yml文件中配置

1
2
3
permalink_pinyin:
enable: true
separator: '-' # 默认分隔符为 '-',按需要自定义

使用

地址栏的中文变成了拼音,中键 - 间隔

阅读全文 »

插件 hexo-generator-feed

安装

1
npm install hexo-generator-feed --save

配置

_config.yml文件中配置

1
2
3
4
5
6
7
8
9
feed:
type: atom
path: atom.xml
limit: 20
hub:
content:
content_limit: 140
content_limit_delim: ' '
order_by: -date

使用

public 文件夹中生成 atom.xml 文件

没搞太明白

阅读全文 »