mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-02-21 11:10:07 +00:00
20 lines
No EOL
826 B
HTML
20 lines
No EOL
826 B
HTML
<!-- compat way of adding custom scripts in old Hugo documentation -->
|
|
{{- $assetBusting := partialCached "assetbusting.gotmpl" . }}
|
|
|
|
{{- $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 }}
|
|
|
|
{{- $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 }} |