Skip to content

alexanderhansen/hugo-awesome-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add awesome image libraries to your hugo project

Currently the folllowing libraries are integrated:

Add as a module to your hugo installation by adding:

[module]
  [[module.imports]]
    path = "github.com/alexanderhansen/hugo-awesome-images"

Include the libraries you want to use in your script loading e.g. <head>

  {{ $lazyload := resources.Get "js/lazyload.min.js" }}
  <script src="{{ $lazyload.Permalink }}"></script>
  
  {{ $lightense := resources.Get "js/lightense.min.js" }}
  <script src="{{ $lightense.Permalink }}"></script>

Put the library partials right before your closing <body> tag.

{{- 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="..." >}}

Local Development

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"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages