
样式的美化
站点配置
如果我们需要对标题做一些修改的话只需要修改博客根目录下的 _config.yml 即可,部分文件内容如下:
title: LeetCode Blog # 这里写博客的标题 subtitle: We are here! # 可以理解为博客的副标题 description: The official LeetCode blog, by LeetCode, from LeetCode keywords: author: LeetCode Content Creator language: zh-CN timezone: # URL ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' url: http://yoursite.com root: / permalink: :year/:month/:day/:title/ permalink_defaults:
主题
在 Themes | Hexo 中有非常多的主题可以供选择:

安装方法非常简单,只需要将主题所在的 GitHub 仓库 clone 到自己的博客的 themes 目录下,并在 _config.yml 中修改以下字段为主题所在的文件夹名称即可:
theme: landscape

发布站点
终于到了要发布的时候啦,我希望和全世界的人分享我的博客,这里我们使用 GitHub 来托管我们的站点,首先创建一个 GitHub 仓库用来存放我们的博客,GitHub 的仓库名称为 <你的用户名>.github.io。
安装 Hexo 的 Git 发布(部署)模块:
npm install hexo-deployer-git --save
然后在 _config.yml中加入以下部分:
deploy: - type: git repo: git@github.com:<用户名>/<仓库名称>.git branch: master message: Blog Update name: <GitHub 用户名> email: <GitHub 邮件地址>
最后,开始发布~
hexo g # 渲染所有页面为 HTML hexo d # 发布!
这个时候如果没有填写 Custom domain 的话, 你的站点地址将会是 <GitHub 用户名>.github.io ,如果有自己的域名且希望使用的话,别忘了在 source 目录下放一个名为 CNAME 的文件(对,没有任何后缀名),内容只有一行,就是自己的域名,将自己的域名做一个 CNAME 解析到 <GitHub 用户名>.github.io 地址即可。
