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

feat: add blurry_image Jinja extension #75

Merged
merged 2 commits into from
Apr 28, 2024
Merged

Conversation

johnfraney
Copy link
Contributor

@johnfraney johnfraney commented Apr 27, 2024

Adds blurry_image extension to insert an tag with width & height into a Jinja template. Optionally inserts an image of a specific size.

Usage:

Basic:
{% blurry_image page.image, alt="Image description" %}

With explicit width (must be present in the build folder):
{% blurry_image page.image, 250, id="image-id", class="responsive-image" %}

Example warning output:

Blurring 17 Markdown files from: content
blurry_image: alt attribute missing for image in WebPage.html
Built site in 1.589002 seconds

TODO:

  • Add alt, title, and loading attribute support
  • Add docs

Adds blurry_image extension to insert an <img> tag with width &
height into a Jinja template. Optionally inserts an image of a
specific size.

Usage:

```
{% blurry_image page.image, width=250 %}
```
@johnfraney johnfraney force-pushed the blurry-image-jinja-plugin branch from ff80255 to 03a52e4 Compare April 27, 2024 18:58
@johnfraney johnfraney marked this pull request as ready for review April 27, 2024 18:59
@johnfraney johnfraney merged commit dc2ac7b into main Apr 28, 2024
4 checks passed
@johnfraney johnfraney deleted the blurry-image-jinja-plugin branch April 28, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant