{"id":20804497,"url":"https://github.com/enjikaka/lume_plugin_squoosh","last_synced_at":"2026-04-22T21:39:57.025Z","repository":{"id":62422150,"uuid":"366132479","full_name":"enjikaka/lume_plugin_squoosh","owner":"enjikaka","description":"Plugin for static site generator Lume to resize and encode images with Squoosh.","archived":false,"fork":false,"pushed_at":"2022-06-14T11:31:19.000Z","size":59,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-19T05:47:13.281Z","etag":null,"topics":["deno","lume","squoosh","static-site-generator"],"latest_commit_sha":null,"homepage":"https://deno.land/x/lume_plugin_squoosh","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enjikaka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-10T17:59:20.000Z","updated_at":"2024-12-28T10:43:42.000Z","dependencies_parsed_at":"2022-11-01T17:33:05.847Z","dependency_job_id":null,"html_url":"https://github.com/enjikaka/lume_plugin_squoosh","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enjikaka%2Flume_plugin_squoosh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enjikaka%2Flume_plugin_squoosh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enjikaka%2Flume_plugin_squoosh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enjikaka%2Flume_plugin_squoosh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enjikaka","download_url":"https://codeload.github.com/enjikaka/lume_plugin_squoosh/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243148981,"owners_count":20244089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","lume","squoosh","static-site-generator"],"created_at":"2024-11-17T19:09:41.479Z","updated_at":"2026-04-22T21:39:51.988Z","avatar_url":"https://github.com/enjikaka.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lume_plugin_squoosh\n\nA plugin for Lume to use Squoosh CLI for handling images for your static site.\n\nRequires that you have Node installed for running Squoosh CLI via npx.\n\n## Usage\n\nIn your Lume `_config.js` file import and add this plugin like so:\n\n```js\nimport squoosh from \"https://deno.land/x/lume_plugin_squoosh@v0.0.9/index.ts\";\n\nconst site = lume();\n\nsite.use(squoosh());\n```\n\nThe squoosh method takes an optional parameter than is an array of formats to generate. If not set, it default to generating WEBP and AVIF.\n\nExample of editing output formats:\n\n```js\nimport squoosh from \"https://deno.land/x/lume_plugin_squoosh@v0.0.9/index.ts\";\n\nconst site = lume();\n\nsite.use(squoosh(['jxl', 'wp2']));\n```\n\nPut your images like normal in the img directory and reference them in your post with an HTML-image tag and specify desired sizes with the `width` and `data-srcset` attribute.\n\n```html\n\u003cimg src=\"/img/2022-01-13-forodling-hyllis.jpg\" width=\"600\" data-srcset=\"1x, 1.5x, 2x\" alt=\"Förodlingsstation med IKEA Hyllis\"\u003e\n```\n\nMake sure that `width` is the same as the actual final element with on your page, for loading performance reasons. `width=\"600\"` and `data-srcset=\"1x, 1.5x, 2x\"` above instructs the plugin to render sizes at 600px, 900px and 1200px.\n\nThe plugin will transform the `\u003cimg\u003e` tag into a `\u003cpicture\u003e` tag with the desired formats from _config.js (or the default ones if not set) and with all the sizes:\n\n```html\n\u003cpicture title=\"Förodlingsstation med IKEA Hyllis\"\u003e\n  \u003csource srcset=\"/img/2022-01-13-forodling-hyllis_600w.webp 600w, /img/2022-01-13-forodling-hyllis_900w.webp 900w, /img/2022-01-13-forodling-hyllis_1200w.webp 1200w\" type=\"image/webp\"\u003e\n  \u003csource srcset=\"/img/2022-01-13-forodling-hyllis_600w.avif 600w, /img/2022-01-13-forodling-hyllis_900w.avif 900w, /img/2022-01-13-forodling-hyllis_1200w.avif 1200w\" type=\"image/avif\"\u003e\n  \u003cimg src=\"/img/2022-01-13-forodling-hyllis_600w.webp\" alt=\"Förodlingsstation med IKEA Hyllis\" width=\"600\" sizes=\"600w\" loading=\"lazy\" decoding=\"async\"\u003e\n\u003c/picture\u003e\n```\n\n## Real world use case\n\nIf you want a real world use-case example this plugin is used for my farm blog.\n\nLive site: https://barlingshult.se\n\nSource: https://github.com/enjikaka/barlingshult\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenjikaka%2Flume_plugin_squoosh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenjikaka%2Flume_plugin_squoosh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenjikaka%2Flume_plugin_squoosh/lists"}