memo
- 这个网站可以作为参考www.ezlippi.com
- npm i(nstall) hexo-generator-json-content --save
Fix error to ensure “all article” works normally. hexo-footnote(已不再维护)npm install hexo-footnotes --save
如果Hexo不能自动发现插件,则需要手动安装插件5,编辑_config.yml文件:12plugins:- hexo-footnotes
- 安装hexo-renderer-marked以支持更多Markdown特性 123npm un hexo-renderer-marked --savenpm i hexo-renderer-markdown-it --savenpm install markdown-it-emoji --save
设置文章置顶 & Cloudinary在线图片服务[1]
top: 3 # 数字越大越靠前,默认为0
除了在本地存储图片,还可以将图片上传到一些免费的CDN服务中。比如Cloudinary提供的图片CDN服务,在Cloudinary中上传图片后,会生成对应的url地址,将地址直接拿来引用即可。
在Cloudinary申请账号,上传图片(注意把upload选项中的unsigned signature选上)
Cloundinary的免费存储空间还是非常大的cloudinary价格
我的cloudinary
使用方法:
- 点击图片
- 点击url
- 拷贝链接
hexo个人命令
-
用
hexol
/hexod
命令一次性完成本地/远程预览
配置.bash_profile
:1234export HEXO='/Users/Aether/Documents/hexo_file'export HEXOMD='/Users/Aether/Documents/hexo_file/source/_posts/'alias hexod='cd $HEXOMD && sh tackle_md.sh && hexo clean && hexo g && hexo deploy'alias hexol='cd $HEXOMD && sh tackle_md.sh && hexo clean && hexo g && hexo s' -
tackle_md.sh
自动调整缩进、设置部分显示(for next theme)1234sh indent.shsh read_more.sh其中,
indent.sh
:12345# indent for code blocksed -i 's/^```[a-z]/ &/g' *.md# indent for quotesed -i 's/^>/ &/g' *.mdread_more.sh
:12345678910# if no "<!-- more -->" in *.md file, adding it into the file.for md_file in $(ls *md)dostat=$(grep "<!-- more -->" $md_file)if [ -z "$stat" ];thensed -i '20a <!-- more -->' $md_filefidone
yilia theme
- image file path
hexo_file/themes/hexo-theme-yilia/source/img
- theme-yilia
yilia
next theme
-
要想显示标签页,需要手动操作,详见[2]
-
添加搜索[3]
在os X safari上无法正常使用,原因不明;在os X chrome上和win7 chrome上都可以正常使用12npm install hexo-generator-search --savenpm install hexo-generator-searchdb --save -
如何设置页面文章的篇数?[4]
123npm install --save hexo-generator-indexnpm install --save hexo-generator-archivenpm install --save hexo-generator-tag -
设置social_icons
next
是通过FontAwesome进行图标设计的,FA支持的图标都在主页上。
目前FA不支持知乎,所以随便选了个fa-bed作为icons。设置中写为zhihu: bed
-
设置文章标题的格式[5]
直接用html就可以
title: <font size=6><b>人工智能简介
next themes的配置文件在themes/next/source/css/_variables/custom.styl
12$font-size-headings-base = 28px$font-size-headings-step = 2px
mathjax
hexo-renderer-mathjax: haven’t maintained since 2016.
npm install hexo-math --save
Example:
Simple inline $a_{i} = b_{i} + c_{i}$.
$$\frac{\partial u}{\partial t}
= h^2 \left( \frac{\partial^2 u}{\partial x^2} +
\frac{\partial^2 u}{\partial y^2} +
\frac{\partial^2 u}{\partial z^2}\right)$$
more available setting
hexo bug
Error: Cannot find module './build/Release/DTraceProviderBindings'
in OS Xnpm install hexo --no-optional
doesn’t worknpm un hexo-cli && npm i hexo-cli -g
still encounts bugs, and it’s about dtrace-provider.- Then we try to install dtrace-provider:
Error: Python executable anaconda3/bin/python is v3.5.2, which is not supported by gyp.
- If
PYTHON=python2.7 npm install dtrace-provider --save
is used then a new bug will be reported:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
- This is an error about Xcode, solution link
- Finally, this DTrace error is solved.
References:
HEXO搭建个人博客
2个小时教你hexo博客添加评论、打赏、RSS等功能
从搭建hexo个人博客过程中理解学习DNS解析