Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add img-simple shortcode #37

Closed
h-enk opened this issue Oct 9, 2020 · 0 comments
Closed

Add img-simple shortcode #37

h-enk opened this issue Oct 9, 2020 · 0 comments
Assignees
Labels
Assigned - Async Issue is assigned to at least one person. PR is assigned to at least one person. enhancement New feature or request
Milestone

Comments

@h-enk
Copy link
Member

h-enk commented Oct 9, 2020

Summary

{{< img-simple src="google-lighthouse-scores-hyas.png" alt="Google Lighthouse Scores Hyas" >}}

Basic example

{{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) -}}
{{ $lqip := $image.Resize $.Site.Params.lqipWidth -}}
<img class="img-simple img-fluid lazyload blur-up" src="{{ $lqip.Permalink }}" data-src="{{ $image.Permalink }}" width="{{ $image.Width }}" height="{{ $image.Height }}" {{ with .Get "alt" }}alt="{{.}}"{{ end }}>

Motivation

For inserting small (lt 500px) images where srcset is not relevant


Click to see Hill for issue #37
Single issue hill
Click to see Hill for all issues
All issue hill

created by Async

@h-enk h-enk added the enhancement New feature or request label Oct 9, 2020
@h-enk h-enk added this to the v1.2.8 milestone Oct 9, 2020
@h-enk h-enk self-assigned this Oct 9, 2020
@h-enk h-enk added the Assigned - Async Issue is assigned to at least one person. PR is assigned to at least one person. label Oct 9, 2020
@h-enk h-enk closed this as completed Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Assigned - Async Issue is assigned to at least one person. PR is assigned to at least one person. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant