Skip to content

Commit

Permalink
feat: add logo type setting option (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruibaby authored Nov 18, 2024
1 parent 03dc038 commit 7841b6c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ spec:
- 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: 显示滚动到顶部按钮
Expand Down
9 changes: 7 additions & 2 deletions templates/modules/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
<div class="flex h-full items-center gap-6">
<div class="mr-2 h-full">
<a href="/" class="inline-flex h-full items-center">
<img th:if="${not #strings.isEmpty(site.logo)}" th:src="${site.logo}" th:alt="Logo" class="h-full w-auto" />
<img
th:if="${theme.config.global.logo_type == 'image'} and ${not #strings.isEmpty(site.logo)}"
th:src="${site.logo}"
th:alt="Logo"
class="h-full w-auto"
/>
<span
th:if="${#strings.isEmpty(site.logo)}"
th:if="${theme.config.global.logo_type == 'text'} or ${#strings.isEmpty(site.logo)}"
id="site-title"
class="text-lg font-medium text-gray-900 dark:text-slate-100"
th:text="${site.title}"
Expand Down

0 comments on commit 7841b6c

Please sign in to comment.