在Hexo官网 文档>自定义>辅助函数>最下面,可以找到toc这个函数,看其介绍能知道它就是来实现文章目录的。
使用toc函数,不显示标题前数字,item为页面中传过去的参数post
|
在左侧栏插入代码
|
修改layout代码
|
- 本文作者: luckyship
- 本文链接: https://luckyship.github.io/2020/09/30/2020-09-30-hexo-add-article-nav/
- 版权声明: 本博客所有文章除特别声明外,均采用 MIT 许可协议。转载请注明出处!
缺失模块。
1、请确保node版本大于6.2
2、在博客根目录(注意不是yilia-plus根目录)执行以下命令:
npm i hexo-generator-json-content --save
3、在根目录_config.yml里添加配置:
jsonContent:
meta: false
pages: false
posts:
title: true
date: true
path: true
text: false
raw: false
content: false
slug: false
updated: false
comments: false
link: false
permalink: false
excerpt: false
categories: false
tags: true