hexo_next博客主题配置

这里就不写博客的介绍了,关于next主题修改可以参考以下这些博客,可能版本不相同,但是配置大致相似。

关闭指定文章的打赏功能

关闭指定文章的打赏功能
1
2
3
4
5
6
7
8
9
10
---
title:
date:
tags:
categories:
只需在文章头部添加下面代码既可以关闭本文章的打赏功能
reward_settings:

enable: false # true
---

1. NexT主题进阶配置

2. 提升Hexo NexT主题加载速度

3. Hexo 博客 静态网站目录文件介绍

4. hexo 个人博客基于 NexT 主题

npm 安装插件

国内更换npm镜像源:

1
npm config set registry http://registry.npm.taobao.org 

npm 出现错误

npm ERR! code CERT_HAS_EXPIRED 可以尝试如下方法

CERT_HAS_EXPIRED 是一个由Node.js和npm抛出的错误,表示你正在尝试访问的服务器的SSL证书已经过期。

  1. 更换npm镜像源

  2. 取消 ssl 验证:

1
npm config set strict-ssl false
  1. 清除npm缓存
1
npm cache clean --force
  1. 开启 ssl 验证:
1
npm config set strict-ssl true

添加备案号

1
2
3
4
5
6
7
8
9
10
# Beian ICP and gongan information for Chinese users. See: https://beian.miit.gov.cn, http://www.beian.gov.cn
beian:
enable: true # false
icp: 湘ICP备XXXXXXXXXXX号-1
# The digit in the num of gongan beian.
gongan_id: xxxxxxxx # 公安号
# The full num of gongan beian.
gongan_num: 粤公网安备xxxxxxxx号 # null
# The icon for gongan beian. See: http://www.beian.gov.cn/portal/download
gongan_icon_url: /images/beian_icon.png # null 存放国徽图标 存放在 next 主题 source\images 目录下

在全国互联网安全管理平台上下载国徽图标,放置在 /themes/next/source/images 下,其显示效果不太理想,修改文件layout/_partials/footer.njk ,代码修改如下

1
2
3
4
5
6
7
8
9
10
11
{%- if theme.footer.beian.enable %}
<div class="beian">
{{- next_url('https://beian.miit.gov.cn', theme.footer.beian.icp + ' ') }}
{%- if theme.footer.beian.gongan_icon_url %}
<img src="{{ url_for(theme.footer.beian.gongan_icon_url) }}" style="display:inline-block;text-decoration:none;height:18px;" alt="">
{%- endif %}
{%- if theme.footer.beian.gongan_id and theme.footer.beian.gongan_num %}
{{- next_url('http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=' + theme.footer.beian.gongan_id, theme.footer.beian.gongan_num + ' ') }}
{%- endif %}
</div>
{%- endif %}

图床配置

[PicGo][https://picgo.github.io/PicGo-Doc/zh/guide/#picgo-is-here]