Skip to content

5 Minutes Setup

Viosey edited this page Oct 6, 2016 · 20 revisions

In Hexo, there are usually have two configuration files, one is in the site root directory _config.yml; the other is in the theme directory _config.yml. For convenience of description, in the following instructions, the former is referred to as a Site Profile, an latter is called a Theme Profile.

Install

Hexo installation of the theme is very simple, just put the theme file in the site directory themes directory, and then modify the configuration file. Specific to the Material, the installation steps are as follows.

Download the Material theme

You can select Clone or [Stable Release Version] (https://github.com/viosey/hexo-theme-material/releases).

In order to facilitate the subsequent update, we recommend the use of cloning. The cloning command is as follows:

$ cd your-hexo-site
$ git clone https://github.com/viosey/hexo-theme-material.git

Enable the Material theme

When the clone is complete, open Site Profile, find the theme field, and change its value to material.

Then find the _config.yml.example file under the theme folder and remove the .example suffix.

Run hexo s --debug and go to http://localhost: 4000 to make sure the site is running properly.

Theme settings

Language

Edit the Site Profile and set language to the language you want. Available languages are:

  • English (en)
  • Simplified Chinese (zh-CN)
  • Traditional Chinese (zh-TW)
  • Spanish (es)
  • Japanese (ja)

For example: Select Traditional Chinese, the configuration is:

Language: en-US



### URL

Edit **site configuration file**, `url` fill in the main domain name, `root` fill in the subdirectory / root domain name

>For example: The domain name of the site is `http://example.com/hexo`:
>
>```Yml
url: http://example.com
root: / hexo

If your site is not running in a subdirectory, root is filled /.

Author name

Edit Site Profile, set author to your nickname.

Site Description Settings

Edit the Site Profile and set the 'description` field to your site description. The site description can be a signature you like :)

Third Party Services

Duoshuo

To use Duoshuo comments, simply fill in the comment: use: field in the **Theme Profile** and set the value to "duoshuo". And then in the comment: shortname:fill in your multi-shortname Note that here is theshortnameis not your Duoshuo login id, it is your Duoshuo second-level domain removed.duoshuo.com` part

For example: Duoshuo second-domain example.duoshuo.com

shortname: example

Leancloud

Wiki - Set up Leancloud view statistics

Busuanzi

To use the Busuanzi View statistics, simply set the value of busuanzi: enable: to true in the Theme Profile.

Among configuration:

  • all_site_uv use for count the number of unique visitors to your site, click on the 3 dots button' in the' blog_info section (on the top right side of the homepage) to see the statistics in the drop down menu.

  • post_pv use for count the number of page views per article, in the article page click on the share button in the drop-down menu to see.

  • busuanzi_pure_mini_js Call the Busuanzi statistics js file, you can put the file into your CDN and then modify the value.