theme: custom.css not written to public #1033

This commit is contained in:
Sören Weber 2025-02-19 21:00:46 +01:00
parent a8d787c37e
commit 713531ec7d
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 17 additions and 5 deletions

View file

@ -1,8 +1,20 @@
<!-- compat way of adding custom scripts in old Hugo documentation -->
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
{{- if or (fileExists "static/css/custom.css") (fileExists "assets/css/custom.css") }}
<link href="{{"css/custom.css" | relURL}}{{ $assetBusting }}" rel="stylesheet">
{{- $filePath := "css/custom.css" }}
{{- with (resources.Get (printf "/%s" $filePath)) }}
<link href="{{ .RelPermalink }}{{ $assetBusting }}" rel="stylesheet">
{{- else }}
{{- if (fileExists (printf "/static/%s" $filePath)) }}
<link href="{{ printf "%s" $filePath | relURL }}{{ $assetBusting }}" rel="stylesheet">
{{- end }}
{{- end }}
{{- if or (fileExists "static/js/custom.js") (fileExists "assets/js/custom.js") }}
<script src="{{"js/custom.js" | relURL}}{{ $assetBusting }}" defer></script>
{{- $filePath := "js/custom.js" }}
{{- with (resources.Get (printf "/%s" $filePath)) }}
<script src="{{ .RelPermalink }}{{ $assetBusting }}" defer></script>
{{- else }}
{{- if (fileExists (printf "/static/%s" $filePath)) }}
<script src="{{ printf "%s" $filePath | relURL }}{{ $assetBusting }}" defer></script>
{{- end }}
{{- end }}

View file

@ -1 +1 @@
7.4.0+942fa83318bb9ac25455cbaae8ab764f90507bfb
7.4.0+a8d787c37e4fd3e417f868b5124b6820a944b170