From 64c314c65460adb4477a7001dae028ccc241bcc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Mon, 24 Mar 2025 15:31:50 +0100 Subject: [PATCH] tree: use correct color for found styles #1067 --- layouts/partials/_relearn/boxStyle.gotmpl | 24 ++++++++++++++++++++++- layouts/partials/shortcodes/tree.html | 4 ++-- layouts/partials/version.txt | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/layouts/partials/_relearn/boxStyle.gotmpl b/layouts/partials/_relearn/boxStyle.gotmpl index 61eb190d77..913c95206f 100644 --- a/layouts/partials/_relearn/boxStyle.gotmpl +++ b/layouts/partials/_relearn/boxStyle.gotmpl @@ -18,7 +18,29 @@ ) }} {{- if eq .identifier $style }} {{- $title := .identifier | T }} - {{- $set = dict "identifier" .identifier "style" $style "title" $title "icon" .icon }} + {{- $set = dict "style" $style "title" $title "icon" .icon }} + {{- break }} + {{- end }} + {{- end }} +{{- end }} +{{- if not $set }} + {{- range (slice + (dict "identifier" "primary") + (dict "identifier" "secondary") + (dict "identifier" "accent") + (dict "identifier" "blue") + (dict "identifier" "cyan") + (dict "identifier" "green") + (dict "identifier" "grey") + (dict "identifier" "magenta") + (dict "identifier" "orange") + (dict "identifier" "red") + (dict "identifier" "default") + (dict "identifier" "transparent") + (dict "identifier" "code") + ) }} + {{- if eq .identifier $style }} + {{- $set = dict "style" $style "title" "" "icon" "" }} {{- break }} {{- end }} {{- end }} diff --git a/layouts/partials/shortcodes/tree.html b/layouts/partials/shortcodes/tree.html index 46b43c0161..151c4490f7 100644 --- a/layouts/partials/shortcodes/tree.html +++ b/layouts/partials/shortcodes/tree.html @@ -13,14 +13,14 @@ {{- $classes := split $icon " " }} {{- if eq (len $classes) 1 }} {{- $boxStyle := partial "_relearn/boxStyle.gotmpl" (dict "style" $color) }} - {{- if $boxStyle.identifier }} + {{- if $boxStyle.style }} {{- $replacement = printf `
  • %s%s` $icon $color $name $rest }} {{- else }} {{- $replacement = printf `
  • %s%s` $icon $color $name $rest }} {{- end }} {{- else }} {{- $boxStyle := partial "_relearn/boxStyle.gotmpl" (dict "style" $color) }} - {{- if $boxStyle.identifier }} + {{- if $boxStyle.style }} {{- $replacement = printf `
  • %s%s` $icon $color $name $rest }} {{- else }} {{- $replacement = printf `
  • %s%s` $icon $color $name $rest }} diff --git a/layouts/partials/version.txt b/layouts/partials/version.txt index 5fc8e52542..0467326a21 100644 --- a/layouts/partials/version.txt +++ b/layouts/partials/version.txt @@ -1 +1 @@ -7.5.0+c062fd1ed2a28faac56d4693a8f6e236345f9706 \ No newline at end of file +7.5.0+c5d591c5149619f251e2a6de0392c513b10b31d1 \ No newline at end of file