Quick Start
Get started with the Redefine theme.
Installation
Install the theme
Execute the following command in the Hexo root directory to install the theme. There are two ways to do it:
npm install hexo-theme-redefine@latest
Enable the theme
In the _config.yml
file located in the Hexo root directory, modify the value of the theme
field to redefine
.
theme: redefine
Create a theme configuration file
Create a file named _config.redefine.yml
in the Hexo root directory.
Copy all the content from here into the file.
This file will automatically override the theme’s configuration options. The purpose of creating this file is to ensure that your configuration is not lost when you update the theme.
VOILA!
Now you can start Hexo and see the results.
Next, please read the configuration notes first and continue configuring the theme.
Configuration Notes
1. Reading the documentation
In the following configurations, xxx.yyy
represents the configuration item yyy
under xxx
in the _config.redefine.yml
file.
For example, info.title
refers to the title
configuration item under info
.
info:
title: Redefine
2. YAML Syntax
The configuration file _config.redefine.yml
uses YAML syntax. If you are not familiar with YAML syntax, please read about it here first.
YAML syntax is based on indentation to denote levels, so please pay attention to indentation.
Please maintain the original indentation and avoid adding extra spaces before configuration items.
3. Configure the theme
All modifications should be made in the _config.redefine.yml
file. It is not recommended to directly modify the theme files because your changes will be overwritten when the theme is updated.
Update
Update the theme
Execute the same command as installation in the Hexo root directory to update the theme:
npm install hexo-theme-redefine@latest
Migrate Configuration
Sometimes, after updating the theme, your configuration file may have new configuration items, or some configuration items may have been deleted, or the names of configuration items may have changed. In such cases, you need to synchronize these configurations with your configuration file.
You can use the File Compare
feature of editors like VS Code to compare the old and new configuration files, and then add the new configuration items to your configuration file.
For example, here are the instructions for comparing files in VS Code for two different installation methods:
In VS Code, hold down the Ctrl
(Windows) or Command
(macOS) key,
select the old configuration file (_config.redefine.yml
),
then select the new configuration file (node_modules/hexo-theme-redefine/_config.yml
).
Click the Compare Selected
button to see the comparison result of the two files, and then proceed with the migration. Please strictly follow the indentation of the old configuration file during the migration.