[English | 中文]
Project Motivation: "Blog Theme Sharing Initiative (Draft)"
Design inspired by: https://www.yinwang.org
Theme Demo: https://www.smallyu.net
-
Supports multiple languages. To modify, change the
language
field in the blog project's_config.yml
file.- en
- zh-cn
-
The purpose of
type: tags
is to identify the current page as a tag page. Currently, it supportstags
,categories
,about
,display
, andmicro-blog
. These are custom contents of the theme and are not documented in Hexo's official documentation. -
About theme configuration:
- Path for icons is under the project's
source
folder (not the theme's source). Directly placefavicon.svg
intosource
. - Many styles are configurable, like post titles, whether to display tags after post links, etc.
- Path for icons is under the project's
-
If you have any questions or encounter any issues while using the theme, feel free to discuss in the issue section or submit a PR.
-
Navigate to the blog project directory.
- If you've already created a blog project, directly navigate to the directory.
- If you haven't yet, run
hexo init blog
to initialize the project. Enter theblog
directory and runnpm i
.
-
Copy the theme into the
themes
directory of your blog project. -
Run the following commands to install necessary dependencies:
npm i --save hexo-renderer-pug
npm i --save hexo-wordcount-sy
-
Configuration for the blog project's
_config.yml
:- Set the
theme
value tohexo-theme-yinwang
. - Set the
highlight
->enable
value tofalse
. - Modify the
subtitle
value to your blog's title.
- Set the
-
Configuration for the theme's
_config.yml
:- No mandatory changes, just a reminder to differentiate from the project's configuration file.
-
Run
hexo clean && hexo server
to start the preview.
Specify which year's micro-blog to show in the theme's configuration, along with the username, repository name, and issue number.
Run this command to create a new page:
hexo new page micro-blog
Open the file source/micro-blog/index.md
and add type: micro-blog
to the front-matter, it should look like this:
---
title: micro-blog
date: 2023-07-26 11:03:03
type: micro-blog
---
You can change the title
as desired.
-
If the
issue_years
content in the configuration file is not empty, the corresponding microblog content will be automatically fetched when executing thehexo generate
command. -
You can also keep the
issue_years
content in the configuration file empty and execute a command likehexo generate 2023
.
Run this command to create a new page:
hexo new page tags
Open the file source/tags/index.md
and add type: tags
to the front-matter, it should look like this:
---
title: Tags Cloud
date: 2022-08-30 18:07:20
type: tags
---
You can change the title
as desired.
Given the complexity of the theme installation, for convenience, a template site is provided with the theme already configured. It can be downloaded and used directly. The template site is initialized with the latest hexo and has no modifications other than necessary configurations.
Template URL: https://github.com/smallyunet/hexo-theme-yinwang-demo
Additional features in the template:
- Latex rendering
- Micro-blog page
- Tags cloud page
- Categories page
- About page
- External links
# Navigation bar without starting with a slash
menu:
Blog: ''
Micro-blog: micro-blog
Tag Cloud: tags
About: about
# Recommended to enable when the page count is more than 1
paginator: false
# Header section
header:
blank: false # Open header links in a new tab
# Article list
list:
date: true # Display date in the article list
wordcount: true # Display word count
# Footer section
footer:
display: false # Display the footer
href: "" # Display the footer as an href
text: "© domain name" # footer content
# Article page
post:
title_h1: true # Use h1 for article titles
blank: false # Open articles in a new tab
backHome: false # Display back to home at the end of the article
backhome_right: false # Align back to home content to the right
backHome_hr: false # Display a divider line before back to home
backHome_prefix: "↶ " # Prefix content for back to home
backHome_content: "Back to Home" # Main content for back to home
backHome_suffix: "" # Suffix content for back to home
show_tags: true # Display tags at the end of the article
# Tag cloud
tags:
all: true # Display all tags on the tag cloud page
# Micro-blog
github:
owner: smallyunet
repo: hexo-blog
micro_blogs:
- year: 2020
issue: 7
- year: 2021
issue: 10
- year: 2022
issue: 19
- year: 2023
issue: 29
issue_years: []
google_analysis:
enable: true
id: G-XXXXXXXXXXX
You can use this hexo plugin: https://github.com/next-theme/hexo-filter-mathjax. There's no need for additional support at the theme level.