netlify-lfs-resize-url
Please note!
Netlify Large Media has now been deprecated. This plugin will no longer be maintained. I would like to take this opportunity to thank everyone who's used it - I hope you've been happy with the service it has provided.
Description
This plugin provides a filter that allows the user to generate Netlify Image Transformation resize URL parameters when working with Netlify Large Media.
Installation
You can install this plugin by running the following command in your project's directory:
lektor plugins add netlify-lfs-resize-url
Usage
The nf_resize filter works in conjunction with the url filter as follows:
{% for image in this.attachments.images %}
<img src="{{ image|url|nf_resize(w=720) }}">
{% endfor %}
The above will return the following:
<img src="/images/example.png?nf_resize=fit&w=720">
Arguments
Arguments correspond to Netlify transformation parameters.
| Argument | Accepts | Default |
|---|---|---|
nf_resize |
'fit', 'smartcrop' | 'fit' |
h |
Positive integers | null |
w |
Positive integers | null |
Development
Testing
All of the tests can be run by executing test.sh with the pipenv shell activated.
Static analysis and checking
mypy is used for static analysis, and flake8 is used for checking:
python -m mypy lektor_netlify_lfs_resize_url.py
python -m mypy test.py
python -m flake8 lektor_netlify_lfs_resize_url.py
python -m flake8 test.py
Unit testing
Python's built-in unittest framework is used for unit testing:
python -m unittest
Security
bandit is used for security testing:
python -m bandit lektor_netlify_lfs_resize_url.py
Uploading the plugin to PyPI
python -m build
python -m twine upload dist/*
Metadata
Release files for lektor-netlify-lfs-resize-url 1.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lektor_netlify_lfs_resize_url-1.0.3.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lektor_netlify_lfs_resize_url-1.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 kB
Release files / lektor_netlify_lfs_resize_url-1.0.3.tar.gz
| Download URL | lektor_netlify_lfs_resize_url-1.0.3.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26dfe8bd921cf80ae5059f28fa7ebde84dd269c0136d08a732d64be36f0af554
|
|
BLAKE2b-256 checksum How to use checksums |
31e7748664fb9331649549772074fc8abd4bb4c0fa363c542e89b77fadd54556
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|
Release files / lektor_netlify_lfs_resize_url-1.0.3-py3-none-any.whl
| Download URL | lektor_netlify_lfs_resize_url-1.0.3-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b12c0a1646010af7381d075b2581fc31bac20d15e81aa481c3f33ab58694ce5
|
|
BLAKE2b-256 checksum How to use checksums |
eff2db3696e317436fc60a02e5453792b0f21f4964e1b099d9693a7e6d38254f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.11.8
|