Files
theme-earth/settings.yaml
Ryan Wang 7e103ff3c0 Optimize settings form and remove deprecated options (#256)
* Optimize settings form and remove deprecated options

* Update required version to 2.22.0 in theme.yaml

The minimum required version for this theme has been updated from 2.20.0 to 2.22.0 to ensure compatibility with newer dependencies or features.

* Update icon rendering to use icon.value property
2025-12-24 12:09:28 +08:00

512 lines
16 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
apiVersion: v1alpha1
kind: Setting
metadata:
name: theme-earth-setting
spec:
forms:
- group: layout
label: 布局
formSchema:
- $formkit: select
name: post_list_layout
label: 文章列表布局
value: grid_3
options:
- label: 网格(一行三列)
value: grid_3
- label: 网格(一行两列)
value: grid_2
- label: 单条
value: single
help: "选择单条时,文章卡片的图片将位于左侧"
- $formkit: select
name: header_widget
id: header_widget
label: 首页顶部模块
value: site_title
options:
- label:
value: none
- label: 最新一篇文章
value: latest_post
- label: 文章网格(最新五篇文章)
value: latest_post_grid
- label: 站点标题
value: site_title
- $formkit: select
if: "$get(header_widget).value !== none"
name: header_background_type
id: header_background_type
key: header_background_type
label: 首页顶部背景
value: image
options:
- label: 手动设置
value: manual
- label: 图片
value: image
- $formkit: text
if: "$get(header_widget).value !== none && $get(header_background_type).value === manual"
name: header_background
id: header_background
key: header_background
label: 首页顶部背景
- $formkit: attachment
if: "$get(header_widget).value !== none && $get(header_background_type).value === image"
name: header_background_image
id: header_background_image
key: header_background_image
label: 首页顶部背景图片
value: /themes/theme-earth/assets/images/default-background-2023-10-12.jpeg
- $formkit: color
if: "$get(header_widget).value === site_title"
name: title_color
id: title_color
key: title_color
label: 标题文字颜色
value: "#ffffff"
- $formkit: checkbox
name: content_header
label: 显示文章页面顶部背景
value: true
- group: global
label: 全局
formSchema:
- $formkit: select
name: logo_type
id: logo_type
label: 菜单栏 Logo 类型
value: image
options:
- label: 文字
value: text
- label: 图片
value: image
- $formkit: checkbox
name: show_scroll_button
label: 显示滚动到顶部按钮
value: true
- group: style
label: 样式
formSchema:
- $formkit: select
name: color_scheme
label: 默认配色
value: system
options:
- label: 跟随系统
value: system
- label: 深色
value: dark
- label: 浅色
value: light
- $formkit: checkbox
name: enable_change_color_scheme
label: 允许访客切换配色
value: true
- group: post
label: 文章
formSchema:
- $formkit: select
name: content_style
label: 内容样式
value: "github"
options:
- label: GitHub 风格
value: github
- label: Tailwind CSS Typography
value: tailwind
- $formkit: select
name: title_position
label: 标题位置
value: "content"
options:
- value: "content"
label: "正文中"
- value: "cover"
label: "封面中"
- $formkit: text
name: cover_height
label: 封面图高度
value: "24rem"
- $formkit: checkbox
name: show_upvote_button
label: 显示点赞按钮
value: true
- $formkit: checkbox
name: show_share_button
id: show_share_button
label: 显示分享按钮
value: true
- $formkit: select
if: $get(show_share_button).value
name: share_item_ids
key: share_item_ids
id: share_item_ids
multiple: true
sortable: true
label: 分享平台
value:
- wechat
- x
- telegram
- facebook
- qq
- qzone
- weibo
- douban
- native
options:
- label: 微信
value: wechat
- label: X
value: x
- label: Telegram
value: telegram
- label: Facebook
value: facebook
- label: QQ
value: qq
- label: QQ 空间
value: qzone
- label: 微博
value: weibo
- label: 豆瓣
value: douban
- label: 系统分享
value: native
- group: sidebar
label: 侧边栏
formSchema:
- $formkit: array
name: widgets
label: 小部件
value:
- value: popular-posts
- value: categories
- value: tags
itemLabels:
- type: "text"
label: "$value.value"
children:
- $formkit: select
name: value
id: value
key: value
label: 部件
options:
- label: 站点资料
value: profile
- label: 热门文章
value: popular-posts
- label: 文章分类
value: categories
- label: 文章标签
value: tags
- $formkit: group
if: "$value.value === profile"
name: options
key: profile-options
id: profile-options
label: 站点资料选项
children:
- $formkit: attachment
name: logo
label: 站点资料 Logo
- $formkit: array
name: social_media
label: 社交媒体
value: []
itemLabels:
- type: "iconify"
label: "$value.icon"
- type: "text"
label: "$value.name"
- type: "text"
label: "$value.url"
children:
- $formkit: iconify
format: svg
name: icon
label: 图标
validation: "required"
- $formkit: text
name: name
label: 名称
- $formkit: text
name: url
label: 链接
validation: "required"
- $formkit: select
name: url_type
label: 链接类型
value: normal
help: "如果选择了图片类型,那么在访客点击之后会使用弹框的形式加载"
options:
- label: 跳转链接
value: normal
- label: 图片
value: image
- $formkit: group
name: profile
help: 已废弃,将在未来的版本移除,请使用上方的站点资料小部件中的配置代替
value:
logo:
children:
- $formkit: attachment
name: logo
label: 站点资料 Logo
- $formkit: array
name: social_media
label: 社交媒体
value: []
help: 已废弃,将在未来的版本移除,请使用上方的站点资料小部件中的配置代替
itemLabels:
- type: "text"
label: "$value.name"
- type: "text"
label: "$value.url"
children:
- $formkit: select
name: icon
label: 图标
options:
- label: 电子邮箱
value: i-tabler-mail
- label: 微信
value: i-simple-icons-wechat
- label: 腾讯 QQ
value: i-simple-icons-tencentqq
- label: 新浪微博
value: i-simple-icons-sinaweibo
- label: 知乎
value: i-simple-icons-zhihu
- label: 豆瓣
value: i-simple-icons-douban
- label: 哔哩哔哩
value: i-simple-icons-bilibili
- label: 抖音 / TikTok
value: i-simple-icons-tiktok
- label: Telegram
value: i-simple-icons-telegram
- label: Facebook
value: i-simple-icons-facebook
- label: Instagram
value: i-simple-icons-instagram
- label: LinkedIn
value: i-simple-icons-linkedin
- label: Twitter
value: i-simple-icons-twitter
- label: Slack
value: i-simple-icons-slack
- label: Discord
value: i-simple-icons-discord
- label: YouTube
value: i-simple-icons-youtube
- label: Steam
value: i-simple-icons-steam
- label: GitHub
value: i-simple-icons-github
- label: GitLab
value: i-simple-icons-gitlab
- label: RSS
value: i-simple-icons-rss
- $formkit: text
name: name
label: 名称
- $formkit: text
name: url
label: 链接
validation: "required"
- $formkit: select
name: url_type
label: 链接类型
value: normal
help: "如果选择了图片类型,那么在访客点击之后会使用弹框的形式加载"
options:
- label: 跳转链接
value: normal
- label: 图片
value: image
- group: footer
label: 页脚
formSchema:
- $formkit: select
name: style
id: style
key: style
label: 页脚风格
value: style_1
options:
- label: 风格一
value: style_1
- label: 风格二
value: style_2
- $formkit: attachment
name: logo
label: Logo
help: 如果不设置,将使用站点设置的 Logo
- $formkit: text
name: title
label: 标题
help: 如果不设置,将使用站点设置的标题
- $formkit: textarea
rows: 3
name: slogan
id: slogan
key: slogan
if: "$get(style).value === style_2"
label: 标语
- $formkit: select
if: "$get(style).value === style_1"
name: right_menu
id: right_menu
key: right_menu
label: 右侧菜单
action: "/api/v1alpha1/menus"
autoSelect: false
clearable: true
requestOption:
labelField: "spec.displayName"
valueField: "metadata.name"
- $formkit: select
if: "$get(style).value === style_2"
name: menu_names
id: menu_names
key: menu_names
label: 菜单组
value: []
multiple: true
sortable: true
action: "/api/v1alpha1/menus"
requestOption:
labelField: "spec.displayName"
valueField: "metadata.name"
- $formkit: array
name: social_media
label: 社交媒体
value: []
itemLabels:
- type: "iconify"
label: "$value.iconify"
- type: "text"
label: "$value.name"
- type: "text"
label: "$value.url"
children:
- $formkit: iconify
name: iconify
label: 图标
format: svg
validation: "required"
- $formkit: text
name: name
label: 名称
- $formkit: text
name: url
label: 链接
validation: "required"
- $formkit: select
name: url_type
label: 链接类型
value: normal
help: "如果选择了图片类型,那么在访客点击之后会使用弹框的形式加载"
options:
- label: 跳转链接
value: normal
- label: 图片
value: image
- $formkit: select
name: icon
label: 图标
help: 已废弃,将在未来的版本移除,请使用上方的图标选择器代替
options:
- label: 电子邮箱tabler:mail
value: i-tabler-mail
- label: 微信simple-icons:wechat
value: i-simple-icons-wechat
- label: 腾讯 QQsimple-icons:tencentqq
value: i-simple-icons-tencentqq
- label: 新浪微博simple-icons:sinaweibo
value: i-simple-icons-sinaweibo
- label: 知乎simple-icons:zhihu
value: i-simple-icons-zhihu
- label: 豆瓣simple-icons:douban
value: i-simple-icons-douban
- label: 哔哩哔哩simple-icons:bilibili
value: i-simple-icons-bilibili
- label: 抖音 / TikToksimple-icons:tiktok
value: i-simple-icons-tiktok
- label: Telegramsimple-icons:telegram
value: i-simple-icons-telegram
- label: Facebooksimple-icons:facebook
value: i-simple-icons-facebook
- label: Instagramsimple-icons:instagram
value: i-simple-icons-instagram
- label: LinkedInsimple-icons:linkedin
value: i-simple-icons-linkedin
- label: Twittersimple-icons:twitter
value: i-simple-icons-twitter
- label: Slacksimple-icons:slack
value: i-simple-icons-slack
- label: Discordsimple-icons:discord
value: i-simple-icons-discord
- label: YouTubesimple-icons:youtube
value: i-simple-icons-youtube
- label: Steamsimple-icons:steam
value: i-simple-icons-steam
- label: GitHubsimple-icons:github
value: i-simple-icons-github
- label: GitLabsimple-icons:gitlab
value: i-simple-icons-gitlab
- label: RSSsimple-icons:rss
value: i-simple-icons-rss
- group: beian
label: 备案设置
formSchema:
- $formkit: text
name: icp_text
label: ICP备案号
- $formkit: text
name: icp_link
label: ICP备案跳转链接
value: https://beian.miit.gov.cn/
- $formkit: text
name: gongan_text
label: 公安联网备案号
- $formkit: text
name: gongan_link
label: 公安联网备案跳转链接
value: https://beian.mps.gov.cn/#/query/webSearch
- group: plugin
label: 插件集成
formSchema:
- $formkit: group
name: docsme
label: Docsme 文档管理
value:
source: theme
children:
- $formkit: select
name: source
label: 模板来源
options:
- label: 由此主题提供
value: theme
- label: 使用插件默认模板
value: plugin