Currently the folllowing libraries are integrated:
[module]
[[module.imports]]
path = "github.com/alexanderhansen/hugo-awesome-images"
{{ $lazyload := resources.Get "js/lazyload.min.js" }}
<script src="{{ $lazyload.Permalink }}"></script>
{{ $lightense := resources.Get "js/lightense.min.js" }}
<script src="{{ $lightense.Permalink }}"></script>
{{- partial "lazyScript.html" . -}}
{{- partial "lightenseScript.html" . -}}
Use the shortcode imgLazy
anywhere in your content any just use it as hugo's build in figure
shortcode.
{{< imgLazy src="..." alt="..." >}}
After cloning run npm install && npm run dist
And add to your hugo config:
[module]
replacements = "github.com/alexanderhansen/hugo-awesome-images -> /your/working/copy/hugo-awesome-images"
[[module.imports]]
path = "github.com/alexanderhansen/hugo-awesome-images"