lazy load images to reduce strain on large page
This commit is contained in:
parent
bd8b5accf2
commit
cf84cb7d93
@ -511,7 +511,7 @@ func getHref(c *cli.Context, fpath string, mtype string) (bool, string, error) {
|
|||||||
href = fmt.Sprintf("<a class='%s' href=\"%s\">%s</a>", stype, fname, fname)
|
href = fmt.Sprintf("<a class='%s' href=\"%s\">%s</a>", stype, fname, fname)
|
||||||
} else {
|
} else {
|
||||||
href = fmt.Sprintf(
|
href = fmt.Sprintf(
|
||||||
"<figure><a href=\"%s\"><img class='thumbnail' src='data:image/jpg;base64,%s'></a><figcaption>%s</figcaption></figure>",
|
"<figure><a href=\"%s\"><img class='thumbnail' loading='lazy' src='data:image/jpg;base64,%s'></a><figcaption>%s</figcaption></figure>",
|
||||||
fname, thumb, caption,
|
fname, thumb, caption,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user