Customize Hexo blog
Customize Hexo Blog. How to create blog is here
General config
title:
description:
author:
index_generator:
per_page: 3
Blog sub directory
I want my blog under a sub directory, https://www.my_site.com/blog/.
In the _config.yml
:
url: https://www.your_site.com/blog
root: /blog/
public_dir: public/blog
Every time, generate the web site. copy the index.html under blog folder to the parent public folder. Folder structure:
public
+-- blog
| +-- index.html
+-- index.html
Change banner image
\themes\landscape\source\css\images\banner.jpg
Image in the post
In the _config.yml
:
post_asset_folder: true
Every time, run hexo new post your-post
, it will create a folder with the same post file name. Put the image in that folder, and reference the image in your post.
{% asset_img image_name.png Image_alt_text %}
Add About page
hexo new page about
Modify the landscape
theme to show the about link on the header menu.
In the themes\landscape\_config.yml
:
menu:
About: /about
Generate feed
Add feed config in _config.yxml
npm install hexo-generator-feed --save
Generate sitemap
Add feed config in _config.yxml
npm install hexo-generator-sitemap --save
Enable Disqus comments
Create a Disqus account.
In the _config.yml
:
disqus_shortname: <your_disqus_unique_site_name>
If you want to disable comment in particular page/post.
---
title:
date:
comments: false
---