Files
sumup/themes/bootstrap5/layouts/partials/head.html

31 lines
1.3 KiB
HTML
Raw Normal View History

2025-11-09 19:57:15 +01:00
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- <link rel="stylesheet" href="{{ "css/style.css"
| relURL }}"> -->
<title>{{ .Site.Title }}</title>
<!-- https://rodneymaiato.dev/posts/how-to-add-the-official-bootstrap-module-in-a-hugo-site/ -->
{{/* Load Bootstrap SCSS. */}}
{{ $options := dict "enableSourceMap" true }}
{{ if hugo.IsProduction }}
{{ $options := dict "enableSourceMap" false "outputStyle" }}
{{ end }}
{{ $styles := resources.Get "scss/styles.scss" }}
{{ $styles := $styles | resources.ToCSS $options }}
{{ if hugo.IsProduction }}
{{ $styles = $styles | fingerprint }}
{{ end }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
{{/* Load Bootstrap JS. */}}
{{ $js := resources.Get "js/index.js" }}
{{ $params := dict }}
{{ $sourceMap := cond hugo.IsProduction "" "inline" }}
{{ $opts := dict "sourceMap" $sourceMap "minify" hugo.IsProduction "target" "es2018" "params" $params }}
{{ $js = $js | js.Build $opts }}
{{ if hugo.IsProduction }}
{{ $js = $js | fingerprint }}
{{ end }}
<script src="{{ $js.RelPermalink }}" {{ if hugo.IsProduction }}integrity="{{ $js.Data.Integrity }}"{{ end }} defer></script>
</head>