Add bootstrap JS

This commit is contained in:
ItsDrike 2021-08-25 11:27:49 +02:00
parent 3610b7a8d9
commit a82ab80745
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD
3 changed files with 15 additions and 1 deletions

View file

@ -2,12 +2,16 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>{{ partial "title-item.html" . }}{{ .Site.Title }}</title>
{{ partial "style.html" "scss/style.scss" }}
{{ partial "style.html" "css/highlight.css" }}
{{ partial "style.html" "css/font-awesome.css" }}
<title>{{ partial "title-item.html" . }}{{ .Site.Title }}</title>
</head>
<body>
{{ block "main" . }}{{ end }}
{{ partial "script_async.html" "js/bootstrap.min.js" }}
{{ block "scripts_extra" . }}{{ end }}
</body>
</html>

View file

@ -0,0 +1,9 @@
{{ $script := resources.Get . }}
{{ if in . "min" }}
{{ $script = $script | minify | fingerprint }}
{{ else }}
{{ $script = $script | js.Build (dict "minify" true) | fingerprint }}
{{ end }}
<script type="text/javascript" async src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>

View file

@ -11,6 +11,7 @@ mkdir -p "$STATIC_BUILD/img"
mkdir -p "$STATIC_BUILD/js"
#cp -r "$STATIC_SRC/js/*" "$STATIC_BUILD/js"
cp $BASEDIR/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js $STATIC_BUILD/js/bootstrap.min.js
mkdir -p "$STATIC_BUILD/css"
#cp -r "$STATIC_SRC/css/*" "$STATIC_BUILD/css"