feat(exampleSite): use image from hugo-mods/examples
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
module:
|
||||
imports:
|
||||
- path: github.com/hugo-mods/lazyimg
|
||||
- path: github.com/hugo-mods/examples
|
||||
# replacements forces using local version for dev instead of using the remote:
|
||||
replacements:
|
||||
- github.com/hugo-mods/lazyimg -> ../../.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
module github.com/hugo-mods/lazyimg/exampleSite
|
||||
|
||||
go 1.13
|
||||
|
||||
require github.com/hugo-mods/examples v0.0.0-20210918100042-096b10688d16 // indirect
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
github.com/hugo-mods/examples v0.0.0-20210918100042-096b10688d16 h1:BbDo6KhO4PE0uaKHh+kGjmMD7GS/F04BAAJMOHmqo50=
|
||||
github.com/hugo-mods/examples v0.0.0-20210918100042-096b10688d16/go.mod h1:Eahgu172rg657c3pNNTPgm+UuYkNF9HLLRg5ETfYvOM=
|
||||
@@ -41,10 +41,10 @@
|
||||
|
||||
<body>
|
||||
<!-- Most basic usage with single parameter that can either be a filename or resource: -->
|
||||
{{ partial "lazyimg" "alps.jpg" }}
|
||||
{{ partial "lazyimg" "images/alps.jpg" }}
|
||||
|
||||
<!-- Here we call the partial by passing a param dict that overrides the site's params: -->
|
||||
{{ partial "lazyimg" (dict "img" "alps.jpg" "class" "my-fancy-class" "alt" "This image shows the alps" "resizer" "simple") }}
|
||||
{{ partial "lazyimg" (dict "img" "images/alps.jpg" "class" "my-fancy-class" "alt" "This image shows the alps" "resizer" "simple") }}
|
||||
|
||||
{{ $images := (partial "images" .) }}
|
||||
{{ range $images -}}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!-- Create different versions of example image to demonstrate lazy-loading: -->
|
||||
{{ $images := slice }}
|
||||
{{ range seq 10 -}}
|
||||
{{ $img := resources.Get "alps.jpg" | images.Filter (images.Hue (add -180 (mul . 36))) }}
|
||||
{{ $img := resources.Get "images/alps.jpg" | images.Filter (images.Hue (add -180 (mul . 36))) }}
|
||||
{{ $images = append $img $images }}
|
||||
{{- end }}
|
||||
{{ return $images }}
|
||||
Reference in New Issue
Block a user