如何使用HEXO创建博客

一、快速开始

Create a new post

1
$ hexo new "My New Post"

Run server

1
$ hexo server

Generate static files

1
$ hexo generate

Deploy to remote sites

1
$ hexo deploy

More Info:

二、设置自动滚动

1
2
# Automatically saving scroll position on each post/page in cookies.
save_scroll: false

三、设置多个tag或category

伪JavaScript数组写法

tag: [Hexo,HTML,JavaScript]
categories: [Hexo,HTML]

四、关于Hexo next主题如何在首页隐藏指定的文章

修改next主题文件夹下的layout中的index.swig文件,\themes\next\layout\index.swig

图示

在新的post中添加visible字段来控制是否首页显示

title: 关于Hexo next主题如何在首页隐藏指定的文章
visible: hide 这里如果加上hide则该文章就不会在文章首页显示,如果留空则表示默认显示

五、HEXO电脑切换

创建hexo分支保存源码,如文中 https://blog.csdn.net/wxl1555/article/details/79293159
知乎大神,https://www.zhihu.com/question/21193762

0%