mirror of https://github.com/onweru/compose.git

weru
24.58.2023 e2784768ae8bb0934adb7e701074235a3519c597
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{{- $variables := partial "functions/getScript" (dict "slug" "variables") }}
{{- $functions := partial "functions/getScript" (dict "slug" "functions") }}
{{- $code := partial "functions/getScript" (dict "slug" "code") }}
{{- $mode := partial "functions/getScript" (dict "slug" "mode") }}
{{- $main := partial "functions/getScript" (dict "slug" "index") }}
 
{{- $customScriptPath := "js/custom.js" }}
{{ if (fileExists "../../assets/js/custom.js") }}
  {{ $customScriptPath := "../../assets/js/custom.js" }}
{{ end }}
{{- $custom := resources.Get $customScriptPath | resources.ExecuteAsTemplate $customScriptPath . }}
 
{{- partial "scripts/getJsBundle" (dict "scripts" (slice $variables $functions $code $mode $main $custom) "slug" "bundle") }}
 
{{- partialCached "scripts/search" . -}}
{{- partialCached "hooks/scripts" . -}}
 
{{- $sp := .Site.Params }}
{{- with $sp.customJS }}
  {{- range . -}}
    <script src="{{ . }}" async></script>
  {{- end }}
{{- end -}}