Skip to content

Commit

Permalink
Merge branch 'main' into xmr/mv-scripts-to-head
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored Mar 30, 2024
2 parents 201e2a9 + 3f23785 commit 3b4b0d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
{{- $esbuildOptions = merge $esbuildOptions (dict "minify" "true") -}}
{{- end -}}

{{- $bootstrapJs := resources.Get "/js/vendor/bootstrap.bundle.min.js" | fingerprint | resources.Copy "/assets/js/vendor/bootstrap.bundle.min.js" -}}
{{- $bootstrapJs := resources.Get "/js/vendor/bootstrap.bundle.min.js" | fingerprint | resources.Copy "/assets/js/vendor/bootstrap.bundle.min.js" }}
<script defer src="{{ $bootstrapJs.RelPermalink }}"></script>

{{- $scripts := slice "js/application.js" "js/lazyload.js" -}}
{{- range $scriptFile := $scripts -}}
{{- $script := resources.Get $scriptFile | js.Build $esbuildOptions | fingerprint | resources.Copy (path.Join "/assets" $scriptFile) -}}

{{- $script := resources.Get $scriptFile | js.Build $esbuildOptions | fingerprint | resources.Copy (path.Join "/assets" $scriptFile) }}
<script defer src="{{ $script.RelPermalink }}"></script>
{{- end -}}
{{- end }}

{{ range .Page.Params.extra_js -}}
{{- range .Page.Params.extra_js }}
<script{{ with .async }} async{{ end }}{{ with .defer }} defer{{ end }} src="{{ .src }}"{{ with .integrity }} {{ printf "integrity=%q" . | safeHTMLAttr }} crossorigin="anonymous"{{ end }}></script>
{{- end -}}
{{- end }}
5 changes: 2 additions & 3 deletions src/layouts/partials/stylesheet.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{{ $sassOptions := dict "targetPath" "/assets/css/style.css" "outputStyle" "expanded" "precision" 6 -}}
{{- $sassOptions := dict "targetPath" "/assets/css/style.css" "outputStyle" "expanded" "precision" 6 -}}
{{- $postcssOptions := dict "use" "autoprefixer" "noMap" true -}}

{{- if hugo.IsProduction -}}
{{- $sassOptions = merge $sassOptions (dict "outputStyle" "compressed") -}}
{{- end -}}

{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions | postCSS $postcssOptions | fingerprint -}}

{{- $style := resources.Get "scss/style.scss" | toCSS $sassOptions | postCSS $postcssOptions | fingerprint }}
<link href="{{ $style.RelPermalink }}" rel="stylesheet">

0 comments on commit 3b4b0d5

Please sign in to comment.