feat: improve the site setting config (#2375)

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind feature
/milestone 2.0
/area core
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
新增系统设置默认资源 yaml
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #2329

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
pull/2354/head^2
guqing 2022-09-04 21:18:10 +08:00 committed by GitHub
parent 555377abfd
commit 693b6cc344
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,132 @@
apiVersion: v1alpha1
kind: Setting
metadata:
name: system
spec:
- group: basic
label: 基本设置
formSchema:
- $formkit: text
label: "站点标题"
name: title
validation: required
- $formkit: text
label: "站点副标题"
name: subtitle
validation: required
- $formkit: text
label: Logo
name: logo
- $formkit: text
label: Favicon
name: favicon
- group: user
label: 用户设置
formSchema:
- $formkit: checkbox
label: "是否公开注册"
value: false
name: allowRegistration
validation: required
- $formkit: text
label: "默认角色"
name: defaultRole
validation: required
- group: themeRules
label: 主题模板路由设置
formSchema:
- $formkit: text
label: "分类页路由前缀"
value: "categories"
name: categories
validation: required | alphanumeric
- $formkit: text
label: "标签页路由前缀"
value: "tags"
name: tags
validation: required | alphanumeric
- $formkit: text
label: "归档页路由前缀"
value: "archives"
name: archives
validation: required | alphanumeric
- $formkit: select
label: "文章详情页访问规则"
value: "/archives/{slug}"
options:
- /archives/{slug}
- /archives/{name}
- /?p={name}
- /?p={slug}
- /{year}/{slug}
- /{year}/{month}/{slug}
- /{year}/{month}/{day}/{slug}
name: post
validation: required
- group: post
label: 文章设置
formSchema:
- $formkit: select
label: "列表排序方式"
name: sortOrder
value: "publishTime"
options:
visitCount: "浏览量"
publishTime: "发布时间"
updateTime: "更新时间"
validation: required
- $formkit: number
label: "列表显示条数"
name: pageSize
value: 10
min: 1
max: 100
validation: required
- $formkit: checkbox
label: "新文章审核"
value: false
name: review
help: "用户发布文章是否需要管理员审核"
- group: seo
label: SEO 设置
formSchema:
- $formkit: checkbox
name: blockSpides
label: "屏蔽搜索引擎"
value: false
- $formkit: textarea
name: keywords
label: "站点关键词"
- $formkit: textarea
name: description
label: "站点描述"
- group: comment
label: 评论设置
formSchema:
- $formkit: checkbox
name: enable
value: true
label: "启用评论"
- $formkit: checkbox
name: requireReviewForNew
value: true
label: "新评论审核"
- $formkit: checkbox
name: systemUserOnly
value: true
label: "仅允许注册用户评论"
- group: codeInjection
label: 代码注入
formSchema:
- $formkit: textarea
label: "全局 head"
name: globalHead
help: "插入代码到所有页面的 head 标签部分"
- $formkit: textarea
label: "内容页 head"
name: contentHead
help: "插入代码到文章页面和自定义页面的 head 标签部分"
- $formkit: textarea
label: "页脚"
name: footer
help: "插入代码到所有页面的页脚部分"