Hexo 搭建个人博客教程 - 6 - 发布博客
非原创 java_world 发表于:2018-07-16 16:33:27
  阅读 :164   收藏   编辑

上一篇:Hexo 搭建个人博客教程 - 5 - 站点主要配置_config.yml

设置menu

位置:~\themes\next下的_config.yml文件,我的在D:\hexo\hexo\themes\next

去掉about和categories的注释

menu:
  home: / || home
  about: /about/ || user
  #tags: /tags/ || tags
  categories: /categories/ || th
  archives: /archives/ || archive
  #schedule: /schedule/ || calendar
  #sitemap: /sitemap.xml || sitemap
  #commonweal: /404/ || heartbeat

创建menu目录及md

#进入hexo站点目录
hexo new page about #创建about
hexo new page categories #创建categories

注意,文件编码请保存为utf-8,否则中文显示可能乱码

这时在目录D:\hexo\hexo\source下就会创建对应的目录,该目录下有名为index.md的文件

  • 编辑categories目录下的index.md文件

---
title: 分类
date: 2018-07-16 14:39:07
type: "categories"
layout: "categories"
---
  • 编辑about目录下的index.md文件

---
title: 关于
date: 2018-07-16 15:24:31
---

查看配置效果

 hexo clean #清除缓存
 hexo generate #生成静态网页
 hexo server #本地预览

访问

http://localhost:4000/

发布博客

hexo new "博客文章标题"
 
D:\hexo\hexo>hexo new "第一篇博客"

输出:

INFO  Created: D:\hexo\hexo\source\_posts\第一篇博客.md

hexo站点目录下的/source/_posts/目录下可以看到生成了名为:第一篇博客.md

hexo采用Markdown语法,参考学习地址:http://www.appinn.com/markdown/

编辑第一篇博客.md

按照markdown语法编写即可

  • 插入图片

![tip](/images/xxx.png)
  • 图片存放位置

hexo站点目录下的source\images

删除系统原来生成的hello-world.md文件

发布

 hexo clean #清除缓存
 hexo generate #生成静态网页
 hexo deploy #发布

 预览

https://malian-tech.github.io/