Now let’s customize the blog.
Picking a theme
A lot of themes are available from here. The theme currently used in this blog is MaterialFlow by kevintan. The installation and basic configuration of MaterialFlow
is straight forward, as described in its GitHub page.
Adding a widget
A widget can be a container of tags, categories, friendly links, etc. This reference provides a good discussion on adding widgets to the blog.
The widgets are stored in <blog>/theme/<your theme>/layout/_widget
. To enable a widget, add several lines to the _config.yml
in the theme folder,
In MaterialFlow
, this specification of widgets is modularized, and described in a seperate file widgets.yml
Adding a page
A page is an important building block of a Hexo-based blog. For example, to enable the “Category” widget, one needs to generate a page,
which generates a folder source\categories
and a file index.md
under that folder. Further, modify this file
Same procedure for generating a page for “Tagcloud”, “About”, etc.
Enable comments using Disqus
The procedure is well described in this article. All one needs to do is to get a disqus account, and generate a shortname for the blog, then in the main _config.yml
file, add
Tips for Markdown
To add categories and tags, in the title section, add,
12categories: <your category>tags: <your tags>To make a partial display of the article content, i.e. “Read more”, on the main site, add
1<!-- more -->
before the contents to be hidden from the main site in the Markdown file.
- To disable comments, in the title section, add, 1comments: false
Additional reference: