variant: fix some resource lookups #1040
Some checks are pending
docs-build-deployment / Run deploy (push) Waiting to run
docs-build / Run build (push) Waiting to run

This commit is contained in:
Sören Weber 2025-03-01 00:36:16 +01:00
parent 521de1e32e
commit 4a4b60ef04
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 4 additions and 4 deletions

View file

@ -234,7 +234,7 @@ Write yet non-dynamic stuff
{{- $themevariant := .themevariant }} {{- $themevariant := .themevariant }}
{{- $identifier := .identifier }} {{- $identifier := .identifier }}
{{- $themecontent := "" }} {{- $themecontent := "" }}
{{- with resources.Get (printf "css/theme-%s.css" $identifier) }} {{- with resources.Get (printf "/css/theme-%s.css" $identifier) }}
{{- $themecontent = replaceRE `([ \t]*)(:root)` "${1}&${2}" .Content }} {{- $themecontent = replaceRE `([ \t]*)(:root)` "${1}&${2}" .Content }}
{{- else }} {{- else }}
{{- errorf "\"theme-%s.css\": file not found in \"assets/css\"; if you are migrating from a theme version older thant 6.0.0, you have to move it over from \"static/css\"" $identifier }} {{- errorf "\"theme-%s.css\": file not found in \"assets/css\"; if you are migrating from a theme version older thant 6.0.0, you have to move it over from \"static/css\"" $identifier }}
@ -256,7 +256,7 @@ Write yet non-dynamic stuff
{{- $themecontent = replaceRE `(&\s*)+:root` "&:root" $tempthemecontent }} {{- $themecontent = replaceRE `(&\s*)+:root` "&:root" $tempthemecontent }}
{{- range findRESubmatch `[ \t]*--CODE-theme\s*:\s*([^;]*?)\s*;` $themecontent }} {{- range findRESubmatch `[ \t]*--CODE-theme\s*:\s*([^;]*?)\s*;` $themecontent }}
{{- $chroma = index . 1 }} {{- $chroma = index . 1 }}
{{- $cssres := resources.Get (printf "css/chroma-%s.css" $chroma) }} {{- $cssres := resources.Get (printf "/css/chroma-%s.css" $chroma) }}
{{- if not $cssres }} {{- if not $cssres }}
{{- errorf "\"chroma-%s.css\": file not found in \"assets/css\"; if you are migrating from a theme version older thant 6.0.0, you have to move it over from \"static/css\"" $chroma }} {{- errorf "\"chroma-%s.css\": file not found in \"assets/css\"; if you are migrating from a theme version older thant 6.0.0, you have to move it over from \"static/css\"" $chroma }}
{{- end }} {{- end }}
@ -264,7 +264,7 @@ Write yet non-dynamic stuff
{{- end }} {{- end }}
{{- if not $chroma }} {{- if not $chroma }}
{{- $chroma = "relearn-light" }} {{- $chroma = "relearn-light" }}
{{- $cssres := resources.Get (printf "css/chroma-%s.css" $chroma) }} {{- $cssres := resources.Get (printf "/css/chroma-%s.css" $chroma) }}
{{- if not $cssres }} {{- if not $cssres }}
{{- errorf "\"chroma-%s.css\": file not found in \"assets/css\"; if you are migrating from a theme version older thant 6.0.0, you have to move it over from \"static/css\"" $chroma }} {{- errorf "\"chroma-%s.css\": file not found in \"assets/css\"; if you are migrating from a theme version older thant 6.0.0, you have to move it over from \"static/css\"" $chroma }}
{{- end }} {{- end }}

View file

@ -1 +1 @@
7.4.1+f3cdaabd291fa40d6b5179a64dd3012975866c74 7.4.1+521de1e32e5e1028825729e00e85cc56e078c02a