在搭建blog所遇到的问题


描述:

hexo、dom常用命令
blog的美化
编写blog的代码
在搭建blog时所遇到的问题


一、hexo常用命令

1
2
3
4
5
6
7
8
9
hexo clean  #用来清理缓存文件

hexo g #生成文件

hexo s(start/server#启动博客

hexo n(new"文件名" #新建文章

hexo d #上传到文件

二、dom常用命令

1
2
3
1.dir #显示所有文件
2.cd #进入文件
3.cd .. #退一层

三、编写blog的语法

Markdown语法

注意:写表格的时候,表格上下都要插入一个空格。


四、blog的美化

参考于https://sevencho.github.io/archives/14534beb.html


五、设置RSS的时候出现错误duplicated mapping key at line 87, column 3:type: atom

解决方法:
先在next中搜索rss:,然后在后面添加:

rss: /atom.xml

然后在博客目录的_config.yml中添加如下代码

#设置RSS

1
2
3
4
5
feed:
-type: atom
path: atom.xml
limit: 20
plugins: hexo-generate-feed

注意是-type:atom
最后hexo g生成就解决啦。


六、点击搜索后出现卡死的情况,后台显示404

解决方法:
1、添加搜索插件:

$ npm install hexo-generator-searchdb –save

2、在主题配置文件_config.yml中添加一下内容:

1
2
3
4
5
6
# Search 
search:
path: ./public/search.xml
field: post
format: html
limit: 10000

3、将主题配置文件_config.yml搜索local_search:

确保enabletrue

1
2
local_search:
enable: true

最后重新启动就可以搜索了。

要不要鼓励一下!
0%