Hexo/hexo-theme-Chic problem summary
1. Set Chinese
-
First
Chic/language
check whether there is zh-CN.yml in -
Open the site configuration file: site root directory /_config.yml
As shown above, change the language to zh-CN
2. Solve the problem of Chinese garbled characters
_config.yml
Will be saved in UTF-8 encoding- If the Chinese in the blog is also garbled, save the .md file in UTF-8 encoding
- Then restart it:
execute:hexo clean && hexo g && hexo s
3. The pictures inserted into the blog cannot be displayed
-
Install the plugin first
npm install https://github.com/CodeFalling/hexo-asset-image --save
-
Modify _config.yml, change post_asset_folder: to true
post_asset_folder: true
-
Then restart it:
execute:hexo clean && hexo g && hexo s
-
Change the image path to ![picture format is optional]
example:
before change
after change
-
Finally execute:
hexo clean && hexo g && hexo s
4. Add a Link icon to the home page
-
Download the compressed package in the Ali icon library and decompress it. The steps are as follows:
-
Click on the shopping cart
-
Click Add To Project
-
Select Symbol, then Download Code
-
Rename the downloaded file to iconfont2 (or other names, use iconfont2 below), and then place it in
Chic/source/fonts
-
Then
source/css/style.styl
introduce the main css in (iconfont css already contains other external resources)
just like the line that already exists, as follows// icon @import "../fonts/iconfont/iconfont.css" //原来的 @import "../fonts/iconfont2/iconfont.css" //现在的
-
Check
Chic/source/fonts/iconfont2/iconfont.css
the class name of the icon (or change it to the class name you want), for example:.icon-bilibili:before { content: "\e504"; }
The class name is bilibili
-
Finally added to _config.yml, as follows:
# config.yml文件 links: Blog: /archives bilibili: url #新增的图标
-
implement:
hexo clean && hexo g && hexo s
After I have performed the above steps, there is space for the icon, and I can click the link, but the icon is not displayed. This is how I solved it
- Copied
iconfont2
the .woff and .woff2 filesChic\source\css
from the
-
Four, blog post
1. Blog post configuration items
configuration item | significance |
---|---|
title | Web Article Title |
date | article creation |
comments | Whether the article comment function is enabled |
tags | article tag |
categories | Article classification |
keywords | article keywords |
Use of the above configuration items:
--------------------------------------
title: ESP32-CAM入门教程
date: 2022-08-08 11:45:53
tags:
- 单片机 //一级分类
- esp32 //二级分类
categories:
- 单片机 //一级分类
- esp32 //二级分类
keywords:
- 单片机 //一级分类
- esp32 //二级分类
---------------------------------------
2. Upload a blog post
Before posting a blog post, you can set Typora like this文件->偏好设置->图像
-
enter first
$ cd myBlog
Again
$ hexo new 'name'
name is the name of the new article, and the path of the article is in
myBlog\source\posts
-
then execute
$ hexo clean $ hexo g $ hexo s $ hexo d
Note: Articles published or changed, must
hexo clean
- s: server
- g: generate
- d: deploy
5. Add Tag and Category pages
-
Hexo initialization does not have any page
tag
,category
you need to add it yourself, execute the command:hexo new page tag hexo new page category
-
Take Tags as an example:
-
Enter
source\tag\index.md
-
--- title: Tag //注意大小写 layout: tag //新增 ---
-
-
category
The page is the same,layout
the field key value iscategory
Note: capitalization and
_config.yml
nav: Posts: /archives Categories: /category Tags: /tag About: /about
Consistent