M310ct's blog

hexploit使用指南

2025-01-24

Demo

1.主题安装

可以通过git clone或下载压缩包的方式将项目下载到本地,在博客目录/themes下创建hexploit文件夹,将项目放进去(目录结构需要和github仓库里展示的一样,建议gitclone!)
打开博客目录下的config文件(在博客主目录和主题目录下都有config文件,注意不要混淆):
修改theme: landscape:

theme: hexploit

2.插件安装

1.RSS插件

在你的博客目录下输入命令(关于npm及博客安装等请自行搜索)

npm install hexo-generator-feed --save

打开博客目录下的config文件,在最后添加对rss的配置

feed:
type: rss
path: rss.xml

3.搜索插件

在你的博客目录下输入命令:

npm install hexo-generator-search --save

打开博客目录下的config文件,在最后添加搜索的配置:

search:
path: search.json
field: all
format: html
limit: 10000

3.添加对应页面

本主题一共支持三个页面,分别是categories,tags和about。

1.新建页面

在博客目录输入命令:

hexo new page categories
hexo new page tags
hexo new page about

2.指定布局文件

这里以categories为例子,打开/source/categories/index.md,修改内容为:

---
title: categories
layout: categories
---

其他页面类似,将categories替换为tags和about

3.修改主题配置文件

打开/themes/hexploit/_config.yml

menu:
- name: Home
url: /
- name: Archives
url: /archives
- name: Categories
url: /categories
- name: Tags
url: /tags
- name: About
url: /about
- name: RSS
url: /rss.xml
sidebar: #侧边栏
enable: true
widgets:
- search #搜索
- notice #公告
- categories #分类
- tags #标签
- links #链接

numlimit: # 限制侧边栏显示的数量
categories: 5
tags: 10

links:
- name: 百度
url: https://www.baidu.com
notice: # 公告栏内容
enable: true # 设置为 true 启用,false 禁用
content: "博客正在进行优化,敬请期待更多内容!" # 公告栏显示的内容
toc: #是否显示文章目录
enable: true

侧边栏部分可以随意修改顺序或者将不使用的注释掉

4.代码高亮

修改博客配置文件:

highlight:
enable: true
line_number: false
auto_detect: false
tab_replace: ''
wrap: true
hljs: true
prismjs:
enable: false
preprocess: true
line_number: true
tab_replace: ''

当前主题是atmo-one-dark,定义在highlight.css中,可自行修改

← Back to Home