{"id":13787046,"url":"https://github.com/andrewmcodes/bridgetown-inline-svg","last_synced_at":"2025-05-12T00:30:42.037Z","repository":{"id":44967193,"uuid":"278840025","full_name":"andrewmcodes/bridgetown-inline-svg","owner":"andrewmcodes","description":"ARCHIVED migrated to bridgetown-svg-inliner","archived":true,"fork":false,"pushed_at":"2022-02-20T03:15:46.000Z","size":108,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-07T01:17:28.237Z","etag":null,"topics":["archived","bridgetown","bridgetown-legacy","bridgetown-plugin","liquid","svg"],"latest_commit_sha":null,"homepage":"https://github.com/ayushn21/bridgetown-svg-inliner","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewmcodes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null},"funding":{"github":"andrewmcodes"}},"created_at":"2020-07-11T10:34:41.000Z","updated_at":"2023-01-28T02:56:02.000Z","dependencies_parsed_at":"2022-09-03T01:10:50.194Z","dependency_job_id":null,"html_url":"https://github.com/andrewmcodes/bridgetown-inline-svg","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewmcodes%2Fbridgetown-inline-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewmcodes%2Fbridgetown-inline-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewmcodes%2Fbridgetown-inline-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewmcodes%2Fbridgetown-inline-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewmcodes","download_url":"https://codeload.github.com/andrewmcodes/bridgetown-inline-svg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253199484,"owners_count":21870082,"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":["archived","bridgetown","bridgetown-legacy","bridgetown-plugin","liquid","svg"],"created_at":"2024-08-03T20:00:25.508Z","updated_at":"2025-05-12T00:30:41.546Z","avatar_url":"https://github.com/andrewmcodes.png","language":"Ruby","funding_links":["https://github.com/sponsors/andrewmcodes"],"categories":["Community Resources","Ruby"],"sub_categories":["Plugins"],"readme":"## 🚨 Archived\n\nThis gem has been replaced by [ayushn21/bridgetown-svg-inliner] and has now been archived since it will not be receiving any future updates as Bridgetown v1.0.0 approaches, which will not be compatible with this gem.\n\n**Upgrade to [ayushn21/bridgetown-svg-inliner] which has a MIT License and works with the latest versions of Bridgetown.**\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003ebridgetown-inline-svg\u003c/h1\u003e\n  \u003cp\u003e\n    \u003ca href=\"LICENSE\" target=\"_blank\"\u003e\n      \u003cimg alt=\"License: GPL-3.0\" src=\"https://img.shields.io/github/license/andrewmcodes/bridgetown-inline-svg\" /\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://badge.fury.io/rb/bridgetown-inline-svg\"\u003e\u003cimg src=\"https://badge.fury.io/rb/bridgetown-inline-svg.svg\" alt=\"Gem Version\" height=\"18\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## Installation\n\nRun this command to add this plugin to your site's Gemfile:\n\n```shell\nbundle add bridgetown-inline-svg -g bridgetown_plugins\n```\n\nOr add the following to your `Gemfile`:\n\n```ruby\ngroup :bridgetown_plugins do\n  gem \"bridgetown-inline-svg\", \"~\u003e 1.1.0\"\nend\n```\n\n## Optional Configuration\n\n```yml\n# bridgetown.config.yml\n\nsvg:\n  # Whether to optimize the SVG files with svg_optimizer.\n  #\n  # Type: Boolean\n  # Optional: true\n  # Default: false\n  optimize: true\n```\n\n## Usage\n\nThis plugin provides the `svg` Liquid tag to your site.\n\nUse the tag in your pages, collections, and components by passing the tag the name of a file:\n\n```liquid\n{% svg path/to/my.svg %}\n```\n\n**Note**: The `.svg` file extension is required.\n\n### Attributes\n\nSet attributes like you would in HTML:\n\n```liquid\n{% svg assets/svg/square.svg width=24 class=\"text-indigo-600\" foo=\"bar\" %}\n```\n\nBridgetown will include the SVG file in your output HTML like this:\n\n```html\n\u003csvg width=\"24\" height=\"24\" class=\"text-indigo-600\" foo=\"bar\" version=\"1.1\" id=\"square\" xmlns=\"http://www.w3.org/2000/svg\" x=\"0\" y=\"0\" viewBox=\"0 0 24 24\" \u003e\n  \u003crect width=\"20\" height=\"20\" x=\"2\" y=\"2\" /\u003e\n\u003c/svg\u003e\n```\n\n**Note**: Anything can be passed through, but we'd recommend setting [valid attributes].\n\n#### Height and Width\n\n`height` is automatically set to match `width` if omitted, and vice versa. Height cannot be left unset because IE11 won't use the viewport attribute to calculate the image's aspect ratio.\n\n### Paths\n\nPaths with a space should be quoted with single or double quotes:\n\n```liquid\n{% svg \"/path/to/my asset.svg\" %}\n```\n\nIf the path is not in quotes, anything after the __first space__ will be considered an attribute.\n\nRelative paths and absolute paths will both be interpreted from Bridgetown's `src` directory:\n\n```liquid\n{% svg \"/path/to/my.svg\" %}\n{% svg \"path/to/my.svg\" %}\n```\n\nShould resolve to `/your/site/src/path/to/my.svg`.\n\n### Variables\n\nLiquid variables will be interpolated if enclosed in double brackets:\n\n```liquid\n{% assign svg_name=\"my\" %}\n{% assign size=40 %}\n{% svg \"/path/to/{{svg_name}}.svg\" width=\"{{size}}\" %}\n```\n\nThis is helpful inside of Liquid components!\n\n### Optimizations\n\nProcessing is done to remove useless data when enabled in the Bridgetown config:\n\n- metadata\n- comments\n- unused groups\n- Other filters from [svg_optimizer]\n- default size\n\nIf any important data gets removed, or the output SVG looks different from input, it's a bug. Please file an issue to this repository describing your problem.\n\nIt does not perform any input validation on attributes. They will be appended as-is to the root node.\n\n## Contributing\n\nContributions, issues and feature requests are welcome!\u003cbr /\u003eFeel free to check [issues page]. You can take a look at the [contributing guide].\n\n## Acknowledgement\n\nThis project was initially forked from [jekyll-inline-svg].\n\n## License\n\nCopyright © 2017-2020 [Sebastien Dumetz]\nCopyright © 2020 [Andrew Mason]\n\nThe following code is a derivative work of the code from the [jekyll-inline-svg] project, which is licensed GPLv3. This code therefore is also licensed under the terms of the GNU Public License, verison 3.\n\n\n[ayushn21/bridgetown-svg-inliner]: https://github.com/ayushn21/bridgetown-svg-inliner\n[Bridgetown, unlike this gem.]: https://bridgetownrb.com\n[valid attributes]: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/svg#Attributes\n[svg_optimizer]: https://github.com/fnando/svg_optimizer\n[issues page]: https://github.com/andrewmcodes/bridgetown-inline-svg/issues\n[contributing guide]: https://github.com/andrewmcodes/bridgetown-inline-svg/blob/main/CONTRIBUTING.md\n[jekyll-inline-svg]: https://github.com/sdumetz/jekyll-inline-svg\n[Sebastien Dumetz]: https://github.com/sdumetz\n[Andrew Mason]: https://github.com/andrewmcodes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewmcodes%2Fbridgetown-inline-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewmcodes%2Fbridgetown-inline-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewmcodes%2Fbridgetown-inline-svg/lists"}