{"id":17807487,"url":"https://github.com/mblode/svgplaceholder","last_synced_at":"2025-03-17T13:31:29.741Z","repository":{"id":62525973,"uuid":"102824978","full_name":"mblode/svgplaceholder","owner":"mblode","description":"A plugin which generates an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates.","archived":false,"fork":false,"pushed_at":"2023-11-03T22:04:55.000Z","size":15,"stargazers_count":10,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T00:36:28.749Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mblode.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-08T06:16:45.000Z","updated_at":"2023-11-03T22:05:00.000Z","dependencies_parsed_at":"2022-11-02T14:15:50.698Z","dependency_job_id":null,"html_url":"https://github.com/mblode/svgplaceholder","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mblode%2Fsvgplaceholder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mblode%2Fsvgplaceholder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mblode%2Fsvgplaceholder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mblode%2Fsvgplaceholder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mblode","download_url":"https://codeload.github.com/mblode/svgplaceholder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243864809,"owners_count":20360360,"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":[],"created_at":"2024-10-27T14:22:11.911Z","updated_at":"2025-03-17T13:31:29.233Z","avatar_url":"https://github.com/mblode.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SVG Placeholder plugin for Craft CMS 3.x\n\nA plugin which generates an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates.\n\n## Requirements\n\nThis plugin requires Craft CMS 3.0.0-beta.23 or later.\n\n## Installation\n\nTo install the plugin, follow these instructions.\n\n1. Open your terminal and go to your Craft project:\n\n        cd /path/to/project\n\n2. Then tell Composer to load the plugin:\n\n        composer require mblode/svgplaceholder\n\n3. In the Control Panel, go to Settings → Plugins and click the “Install” button for svgplaceholder.\n\n## Usage\n\n```\n{{ craft.svgplaceholder.generate({height:500,width:'300'}) }}\n```\n\nOptionally add a background color with the fill attribute: \n```\n{{ craft.svgplaceholder.generate({height:500,width:'300'},'#CCCCCC') }}\n```\n\n## Example\n\nWhen used with Lazysizes and a macro:\n\n*_macros/utilities.html*\n```\n{% macro lazyLoadImage(element, transform) %}\n        {% cache using key element.id %}\n            \u003cimg class=\"lazyload\" src=\"{{ craft.svgplaceholder.generate({ height: element.height(transform), width: element.width(transform) }) }}\" data-src=\"{{ element.url(transform) }}\" alt=\"{{ element.title }}\"\u003e\n        {% endcache %}\n{% endmacro %}\n```\n\n*index.html*\n```\n{% import '_macros/utilities' as utils %}\n\n...\n\n{{ utils.lazyLoadImage(image, 'imageTransformName') }}\n```\n\n---\n\nBrought to you by [Matthew Blode](https://matthewblode.com)\n\nBased on the Craft CMS 2 plugin: [SVG Placeholder](https://github.com/daltonrooney/svgplaceholder)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmblode%2Fsvgplaceholder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmblode%2Fsvgplaceholder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmblode%2Fsvgplaceholder/lists"}