| | |
| | | {{- $searchPath := "js/search.js" }} |
| | | {{- $search := resources.Get $searchPath | resources.ExecuteAsTemplate $searchPath . }} |
| | | |
| | | {{- $modePath := "js/mode.js" }} |
| | | {{- $mode := resources.Get $modePath | resources.ExecuteAsTemplate $modePath . }} |
| | | |
| | | {{- $mainScriptPath := "js/index.js" }} |
| | | {{- $main := resources.Get $mainScriptPath | resources.ExecuteAsTemplate $mainScriptPath . }} |
| | | |
| | |
| | | {{ end }} |
| | | {{- $custom := resources.Get $customScriptPath | resources.ExecuteAsTemplate $customScriptPath . }} |
| | | |
| | | {{- $bundle := slice $variables $functions $code $main $fuse $search $custom | resources.Concat "js/bundle.js" | resources.Fingerprint "sha512" }} |
| | | <script src="{{ $bundle.Permalink }}"></script> |
| | | {{- $bundle := slice $variables $functions $code $mode $main $fuse $search $custom | resources.Concat "js/bundle.js" | resources.Fingerprint "sha512" }} |
| | | <script src="{{ $bundle.Permalink }}" async></script> |
| | | |
| | | {{- partialCached "hooks/scripts" . -}} |
| | | |
| | | {{- $sp := .Site.Params }} |
| | | {{- with $sp.customJS }} |
| | | {{- range . -}} |
| | | <script src="{{ . }}"></script> |
| | | <script src="{{ . }}" async></script> |
| | | {{- end }} |
| | | {{- end -}} |