Add jquery

This commit is contained in:
ItsDrike 2021-08-25 19:36:37 +02:00
parent 4548c18688
commit 2ab2765363
No known key found for this signature in database
GPG key ID: B5F6B41F708C3ADD
5 changed files with 25 additions and 2 deletions

View file

@ -13,6 +13,7 @@
{{ block "main" . }}{{ end }} {{ block "main" . }}{{ end }}
{{ partial "footer.html" . }} {{ partial "footer.html" . }}
{{ partial "script.html" "js/jquery.min.js" }}
{{ partial "script_async.html" "js/bootstrap.min.js" }} {{ partial "script_async.html" "js/bootstrap.min.js" }}
{{ block "scripts_extra" . }}{{ end }} {{ block "scripts_extra" . }}{{ end }}
</body> </body>

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" src="{{ $script.RelPermalink }}" integrity="{{ $script.Data.Integrity }}"></script>

13
package-lock.json generated
View file

@ -6,7 +6,8 @@
"": { "": {
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4", "@fortawesome/fontawesome-free": "^5.15.4",
"bootstrap": "^5.1.0" "bootstrap": "^5.1.0",
"jquery": "^3.6.0"
} }
}, },
"node_modules/@fortawesome/fontawesome-free": { "node_modules/@fortawesome/fontawesome-free": {
@ -39,6 +40,11 @@
"peerDependencies": { "peerDependencies": {
"@popperjs/core": "^2.9.3" "@popperjs/core": "^2.9.3"
} }
},
"node_modules/jquery": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
} }
}, },
"dependencies": { "dependencies": {
@ -58,6 +64,11 @@
"resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.0.tgz", "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.1.0.tgz",
"integrity": "sha512-bs74WNI9BgBo3cEovmdMHikSKoXnDgA6VQjJ7TyTotU6L7d41ZyCEEelPwkYEzsG/Zjv3ie9IE3EMAje0W9Xew==", "integrity": "sha512-bs74WNI9BgBo3cEovmdMHikSKoXnDgA6VQjJ7TyTotU6L7d41ZyCEEelPwkYEzsG/Zjv3ie9IE3EMAje0W9Xew==",
"requires": {} "requires": {}
},
"jquery": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
} }
} }
} }

View file

@ -1,6 +1,7 @@
{ {
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.15.4", "@fortawesome/fontawesome-free": "^5.15.4",
"bootstrap": "^5.1.0" "bootstrap": "^5.1.0",
"jquery": "^3.6.0"
} }
} }

View file

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