- 所有相关hexo和next主题的部署都要按照官方手册进行修改,否则其他地方的教程没有更新,容易出错,后患无穷!!!!!!!!!!!!
- 环境配置,注意node,npm,git为全局环境,而hexo为某个文件夹下的环境,也就是你博客的位置,在博客根目录下打开git bash here或者在地址栏打出cmd,则会出现下面的界面(安装完环境之后):
- 从本地git上传数据之后,gitee pages页面不会实时刷新页面,可以手动刷新:
- 部署gitee的用户名和域名的时候两者需要一致,且不要出现大写字母,因为最后gitee pages的网址只有小写,否则会导致网页加载不出正常样式的问题。
- local_search功能需要在root文件夹下的_config.next.yml、_config.yml,和next或root\node_modules\hexo-theme-next文件夹中修改enable为true,否则会出现异常。
- github与gitee本地git上传切换
由于本人在两个网站上的账户名(605458008@qq.com)是一样的,而且没有设定密码,只是用ssh密钥通信,所以只要把本地的公钥保存在两个网站上,切换的时候就不需要修改这一方面。
需要修改的只是root文件夹中的_config.yml文件中的url、repo和branch:
- 文章加密
最新版的hexo-blog-encrypt插件加密方式是直接在.md文件的开头添加password字段:
---
title: 双对数坐标(log-log)下“斜率”“幅值”等概念对应到线性坐标下的实际含义
date: 2022/4/3 20:46:25
tags: log-log
categories: 绘图
comments: true
password: tenghq11
---
在使用hexo-blog-encrypt插件(github官方文档)加密时,文章中的公式不会被解释,或者其他异常,此时,需要在.md文件的最下方加入公式的代码(一般选择文章中公式最长的一段),如下:
<script>
// add script tag and code at the end of your post
$$
\begin{equation}
\begin{aligned}
x_{\log\_linear}&=\log(x_{real})\\
y_{\log\_linear}&=\log(y_{real})\\
y_{\log\_linear}&=k_{\log\_linear}x_{\log\_linear}+b_{\log\_linear}\\
\Rightarrow \log(y_{real})&=k_{\log\_linear}\log(x_{real})+\log10^{b_{\log\_linear}}\\
\Rightarrow \log(y_{real})&=\log(x_{real})^{k_{\log\_linear}}+\log10^{b_{\log\_linear}}\\
\Rightarrow \log(y_{real})&=\log((x_{real})^{k_{\log\_linear}}10^{b_{\log\_linear}})\\
\Rightarrow y_{real}&=(x_{real})^{k_{\log\_linear}}10^{b_{\log\_linear}}
\end{aligned}
\end{equation}
$$
</script>
如果文件中其他字符解释异常则可以把异常的相对应的代码复制到文中的最下方:
<script>
// add script tag and code at the end of your post
异常代码
</script>
注意在输入密码之后,还是解释混乱,此时刷新一下页面即可。
- 使用gitalk时,需要在_config.yml文件中配置一下:
# Gitalk
# For more information: https://gitalk.github.io
gitalk:
enable: true
github_id: teengad # GitHub repo owner
repo: blogcomment # Repository name to store issues
client_id: de6a4a04db581e77106 # GitHub Application Client ID
client_secret: 99aa37b1dc72d06e9411cbbd01815db648959e3 # GitHub Application Client Secret
admin_user: teengad # GitHub repo owner and collaborators, only these guys can initialize gitHub issues
distraction_free_mode: true # Facebook-like distraction free mode
# When the official proxy is not available, you can change it to your own proxy address
proxy: https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token # This is official proxy address
# Gitalk's display language depends on user's browser or system environment
# If you want everyone visiting your site to see a uniform language, you can set a force language value
# Available values: en | es-ES | fr | ru | zh-CN | zh-TW
language: zh-CN
然后在配置OAuth时,需要注意:
其中Homepage URL为github pages的完整链接,Authorization callback URL为github pages的自定义链接。
在公式中使用\tag{}时候需要注意不要写在\begin{aligned}与\end{aligned}中间,而应该放在\end{aligned}之后:
$$
\begin{aligned}
f(a,b)&=q_{1}f(\frac{1}{q_{1}}a,b)\\
\Rightarrow\frac{1}{q_{1}}f(a,b)&=f(\frac{1}{q_{1}} a,b)
\end{aligned}
\tag{4}
$$
- 在部署math模块的时候,在_config.yml文件时需要添加:
# 这个配置文件里也必须有,不然有些显示有问题,依赖pandoc,请自行安装
# https://theme-next.js.org/docs/third-party-services/math-equations.html
# Math Formulas Render Support
math:
# Default (false) will load mathjax / katex script on demand.
# That is it only render those page which has `mathjax: true` in front-matter.
# If you set it to true, it will load mathjax / katex script EVERY PAGE.
every_page: true
mathjax:
enable: true
# Available values: none | ams | all
tags: none
katex:
enable: false
# See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex
copy_tex: true
在_config.next.yml文件中需要添加:
# Math Formulas Render Support
# Warning: Please install / uninstall the relevant renderer according to the documentation.
# See: https://theme-next.js.org/docs/third-party-services/math-equations
# Server-side plugin: https://github.com/next-theme/hexo-filter-mathjax
math:
# Default (false) will load mathjax / katex script on demand.
# That is it only render those page which has `mathjax: true` in front-matter.
# If you set it to true, it will load mathjax / katex script EVERY PAGE.
every_page: true
mathjax:
enable: true
# Available values: none | ams | all
#tags: ams
cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
katex:
enable: false
# See: https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex
copy_tex: true