hexojs / hexojs/hexo

Verify the configuration file

Open
#4,580 1 comment 1 reaction 0 assignees View on GitHub
enhancement feature-request proposal
Dominant language
TypeScript
Stars
41.8k
Forks
41
PR merge metrics
No merged PRs in 30d

Description

## Check List

Please check followings before submitting a new feature request.

- [x] I have already read [Docs page](https://hexo.io/docs/)
- [x] I have already searched existing issues

## Feature Request

> ## Expected behavior
> Verify the configuration file of the theme, when our configuration changes, or the user fills in the wrong content, wecan remind the user to modify.
>
> I try to use ajv check
>
> * https://github.com/ajv-validator/ajv
>
> ```shell
> yarn add hexo-theme-cake
> # modify `theme` to `cake`
> # exec check. see impl: https://github.com/jiangtj/hexo-theme-cake/blob/master/lib/console/check.js
> hexo check
> ```
>
> But the problem is that we need to maintain a huge json-schema. Even the compressed next theme (cake), config file line about 140. ~The schema has 276 lines. [schema.json](https://github.com/jiangtj/hexo-theme-cake/blob/master/lib/console/schema.json).~ The schema has 160 lines. [schema.yml](https://github.com/jiangtj/hexo-theme-cake/blob/master/lib/console/schema.yml).
>
> Do you think? @stevenjoezhang
>
> ## Example
> When I fill in a wrong value
>
> ![image](https://user-images.githubusercontent.com/15902347/83736721-9ee62c00-a684-11ea-9123-5edfa40c3776.png)

_Originally posted by @jiangtj in https://github.com/next-theme/hexo-theme-next/issues/20_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.