This is a Hugo Components that packages a variety of libaries commonly in use at InterExchange.
You need the Hugo extended version and Go to use this component.
We may want to add more libaries to these modules over time.
Following the Use Hugo Modules Docs to learn more about the system.
[[module.imports]]
path="github.com/FortAwesome/Font-Awesome" # source repository
[[module.imports.mounts]]
source = "scss" # source repository directory
target = "assets/scss/font-awesome" # module asset location
[[module.imports.mounts]]
source = "js" # source repository directory
target = "assets/js/font-awesome" # module asset location
hugo
modified: go.mod
modified: go.sum
This was the default
github.com/FortAwesome/Font-Awesome v4.7.0+incompatible // indirect
Changed to the most recent version, which doesn't have the v prefix
github.com/FortAwesome/Font-Awesome 5.15.4 // indirect
git co go.sum
hugo
git commit -m "Added Font Awesome Support"
git tag v1.0.5
Add the component to your Hugo site's config:
[module]
[[module.imports]]
path = "github.com/interexchange/hugo-modules"
The Bootstrap SCSS will be mounted in assets/scss/bootstrap
, so you can then import either all:
@import "bootstrap/bootstrap";
Or only what you need:
@import "bootstrap/functions";
@import "bootstrap/variables";
@import "bootstrap/mixins";
@import "bootstrap/root";
@import "bootstrap/reboot";
@import "bootstrap/type";
@import "bootstrap/images";
@import "bootstrap/code";
@import "bootstrap/grid";
@import "bootstrap/tables";
@import "bootstrap/forms";
@import "bootstrap/buttons";
@import "bootstrap/transitions";
@import "bootstrap/dropdown";
@import "bootstrap/button-group";
@import "bootstrap/input-group";
@import "bootstrap/custom-forms";
@import "bootstrap/nav";
@import "bootstrap/navbar";
@import "bootstrap/card";
@import "bootstrap/breadcrumb";
@import "bootstrap/pagination";
@import "bootstrap/badge";
@import "bootstrap/jumbotron";
@import "bootstrap/alert";
@import "bootstrap/progress";
@import "bootstrap/media";
@import "bootstrap/list-group";
@import "bootstrap/close";
@import "bootstrap/toasts";
@import "bootstrap/modal";
@import "bootstrap/tooltip";
@import "bootstrap/popover";
@import "bootstrap/carousel";
@import "bootstrap/spinners";
@import "bootstrap/utilities";
@import "bootstrap/print";
You will also need to specify the versions you wish you use
$fa-font-path: "/webfonts/fontawesome"; // we store the fonts under a namespaced directory
@import 'font-awesome/fontawesome'; // github.com/interexchange/hugo-modules
@import 'font-awesome/solid';
@import 'font-awesome/regular';
@import 'font-awesome/brands';
The Bootstrap JS bundles will be mounted in assets/js/bootstrap
. Within Hugo pages
you can import it as follows to deliver one combined JS file for your site.
{{ $bootstrap := resources.Get "js/bootstrap/bootstrap.bundle.js" }}
{{ $site := resources.Get "js/site.js" }}
{{ $defaultJS := slice $bootstrap $site | resources.Concat "js/global.js" }}
{{ $globalJS := $defaultJS | resources.Minify | resources.Fingerprint }}
<script src="{{ $globalJS.Permalink }}" integrity="{{ $globalJS.Data.Integrity }}"></script>
{{ $jquery := resources.Get "js/jquery/jquery.min.js" }}
{{ $site := resources.Get "js/site.js" }}
{{ $defaultJS := slice $jquery $site | resources.Concat "js/global.js" }}
{{ $globalJS := $defaultJS | resources.Minify | resources.Fingerprint }}
<script src="{{ $globalJS.Permalink }}" integrity="{{ $globalJS.Data.Integrity }}"></script>
{{ $jscookie := resources.Get "js/js-cookie/js.cookie.js" }}
{{ $site := resources.Get "js/site.js" }}
{{ $defaultJS := slice $jscookie $site | resources.Concat "js/global.js" }}
{{ $globalJS := $defaultJS | resources.Minify | resources.Fingerprint }}
<script src="{{ $globalJS.Permalink }}" integrity="{{ $globalJS.Data.Integrity }}"></script>
{{ $jscookie := resources.Get "js/js-cookie/js.cookie.js" }}
{{ $jquery := resources.Get "js/jquery/jquery.min.js" }}
{{ $bootstrap := resources.Get "js/bootstrap/bootstrap.bundle.js" }}
{{ $site := resources.Get "js/site.js" }}
{{ $defaultJS := (slice $jscookie $jquery $bootstrap $site) | resources.Concat "js/global.js" }}
{{ $globalJS := $defaultJS | resources.Minify | resources.Fingerprint }}
<script src="{{ $globalJS.Permalink }}" integrity="{{ $globalJS.Data.Integrity }}"></script>
This repository is a fork of https://github.com/gohugoio/hugo-mod-bootstrap-scss-v4 to explore bootstrap js, inspired by https://github.com/denolteholding/hugo-mod-bootstrap-scss-js-v5.
Please refer to the original repository for proper update cycles and maintenance.