Verson: 0.0.1
Foreword
This blog post mainly introduces the blog theme Chic designed by Zijian Liu.
Chic
Features
- An elegant, powerful, easy-to-read Hexo theme.
- Appropriate blank blocks, elegant but not simple.
- Light/Dark theme, just one click.
- Abundant highlight mode.
- Elaborately selected fonts, best reading experience. “Microsoft Jhenghei” especially recommended.
- Auto fit Mobile and Screen responsively.
- Support MathJax, support formula written in LaTeX.
Installation
1 | cd your-blog/themes |
Configuration
1 | # Header |
Add Tag and Category Page
There is no tag
or category
page in the site as it initializes. If you need it, please follow the steps below.
- Execute commands
1
2
3hexo new page tag
hexo new page category
hexo new page about - Enter the dictionary
1
cd source/tag
- Add “layout” key
1
2
3
4
5// source\tag\index.md
---
title: Tag
layout: Tag
--- - Do so with the category page with
Category
as title andCategory
as layout.
MathJax - Render LaTeX formula
Related config file Chic/_config.yml
:
1 | # plugin functions |
mathjax
uses the keywords below:
enable
: valuetrue
enables mathjax (default valuetrue
); valuefalse
disables it.import
: this key sets mathjax load method, options can beglobal
ordemand
.
global
: global import, all pages will load script. It’s convenient, but it may cause some MarkDown grammars to be parsed wrong. For example, consecutive$$
will be rendered as a formula; Besides, global import will waste performance in pages without any formula.demand
: [Recommended] Import mathjax when you need it. After you set this value, if you need to use formula, just declare it in the post Front-matter. Here is an example:LaTeX grammars will not be illustrated in this doc. In Chic theme, single1
2
3
4
5
6---
title: MathJax Test
date: 2023-01-01 08:00:00
tags:
mathjax: true # add this statement, MathJax will be enabled in this post.
---$
rounded statement is regarded as inline formula like$f(x)=ax+b$
; double$
rounded statement is regarded as block formula like$$f(x)=ax+b$$
.
Image-title
You have 2 methods to import images in your posts:
- Image import with GFM (without image-title)
1

- hexo built-in image tag (with image-title) So if you want to import as fast as possible, you can use GFM, and this way will also get the best adaptability.
1
{% img [class names] /path/to/image [width] [height] '"alt text" "title text"' %}
If you want to display image-title, you should use hexo built-in image tag.
"alt text"
is used when the image doesn’t load or something went wrong in that image (404)."title text"
will be displayed below the image.
Customize
- Highlight Style: Enter
hexo-theme-Chic\themes\Chic\source\css\style.styl
change stylesheet with key word_highlight
in link in_highlight
dictionary. - Customize stylesheets in this stylus file:
hexo-theme-Chic\themes\Chic\source\css\custom.styl
. - Customize javascripts in the dictionary:
hexo-theme-Chic\themes\Chic\source\js
. Then add declaration in_config.yml
using the keyword ‘script’.
F&Q
I deployed my site on a second-level url (such as username.github.io/blog), and my css, avatar and other sources are missing (404 error)
Answer: You need to change some URLs in root config keyword. For instance:1
2
3
4
5
6
7
8# (blog/_config.yml)
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://siricee.github.io/hexo-theme-Chic/ # this is your deploy url.
root: /hexo-theme-Chic/ # this is your root folder url.
permalink: :year/:month/:day/:title/
permalink_defaults:How to set the dark theme as default for whole site automatically?
Answer: You need to change some code inthemes\Chic\source\js\script.js
, function doucument.ready as shown below.1
2
3
4
5
6document.ready(
function () {
// ...Omit part of the code
const isDark = currentTheme === 'dark';
// change this line to
// const isDark = currentTheme !== 'dark';