@robert.tools/eleventy-filter-svg
v1.0.1
Published
Makes an svg image inline.
Maintainers
Readme
🗂️ @robert.tools/eleventy-filter-svg
Makes an svg image inline.
📜 Usage
🟢 Installation
npm install @robert.tools/eleventy-filter-svg📝 Sample usage
import svg from '@robert.tools/eleventy-filter-svg';📜 Usage
{{ 'file.svg' | svg }} {# get svg from current folder or assets folder #}
{{ 'file.svg' | svg([100, 200]) }} {# get svg with specified dimensions #}
{{ 'file.svg' | svg(100) }} {# get svg with single dimension (width==height) #}
{{ 'file.svg' | svg(100, 'my-css-class', { ariaHidden: true }) }} {# get svg with a CSS class and additional attributes #}🗃️ commands
After an npm install with npm i the following commands are available:
- initialize placeholders:
npm run init <semantic> - release a new version:
npm run release <semantic>
⚖️ Notes
This software is hand-crafted, test-driven and assisted by AI tools. I know each line of my code. ✌️
| Tool | Comment | | ------------- | ------------- | | | Test-driven development with Jest | | | Part of the robert.tools ecosystem | | | Code completion | | | chatGPT research |
