Installing a `Hexo` theme is straightforward. Simply copy the `Hexo-theme-cosy` directory to the `themes` directory, and then modify the theme configuration in `Hexo`'s `_config.yml`.
You can find different language files in `hex theme liner/languages`. If you want to switch languages, fill in the file name of `yml` in the `_config.yml` file
First, register as a `LeanCloud` international user and create a database.
Please proceed in accordance with relevant regional regulations.
```yml
valine:
enable: true
# 替换
appId: appId
# 替换
appKey: appKey
avatar: monsterid
cdn: //unpkg.com/valine@latest/dist/Valine.min.js
# 替换
serverURLs: //xxxxxxxx.api.lncldglobal.com
```
# Algolia Search
The blog comes with built-in local search, based on frontend development, which may have some issues. It's recommended to switch to `Algolia`. The free account has a total of 10,000 records and 100,000 operations per month.
This is a Hexo blog post index plugin that automates the submission of indexes to Algolia.
> If you encounter any problems, you can read the [hexo-algoliasearch repository](https://www.npmjs.com/package/hexo-algoliasearch) for the latest instructions.
Installation command:
```bash
npm install hexo-algoliasearch --save
```
## Using Algolia
Before publishing each blog post, carry out index uploading operations. The usual commands are as follows:
Cosy mainly targets domestic users and integrates QWeather cards on the homepage. Register via [QWeather Developer Service](https://dev.qweather.com/docs/start/).
In Hexo's Markdown files, a typical YAML-formatted `Front Matter` might look like this:
```markdown
---
title: My Article Title
categories:
- javascript
tags:
- Programming
- JavaScript
---
```
## top
To pin an article to the top, assign a numerical value to the `top` metadata. Articles with a specified `top` value will be marked with a 📌 icon in the category list.
For example, if there are three articles:
- Article 1
```markdown
---
title: Article 1
top: 0
categories:
- javascript
---
```
- Article 2
```markdown
---
title: Article 2
top: 1
categories:
- javascript
---
```
- Article 3
```markdown
---
title: Article 3
categories:
- javascript
---
```
Then, under the `javascript` category, the sort order will be: `Article 1 > Article 2 > Article 3`.
This is used to differentiate the status of articles and can be quickly `filtered` using the category list. The Cosy theme comes with 4 built-in statuses: