{"id":26387589,"url":"https://github.com/pumpncode/fresh-plugin-svg-inject","last_synced_at":"2026-02-25T10:34:10.491Z","repository":{"id":215957070,"uuid":"740136366","full_name":"pumpncode/fresh-plugin-svg-inject","owner":"pumpncode","description":"This is a plugin for fresh that injects SVGs referenced in img tags into the rendered html text.","archived":false,"fork":false,"pushed_at":"2025-11-15T21:32:26.000Z","size":230,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-15T04:26:41.648Z","etag":null,"topics":["deno","fresh","fresh-plugin"],"latest_commit_sha":null,"homepage":"https://deno.land/x/fresh_plugin_svg_inject","language":"JavaScript","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/pumpncode.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["pumpncode","nnmrts"]}},"created_at":"2024-01-07T16:26:44.000Z","updated_at":"2025-01-08T07:19:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"de1ea898-ccfc-4ca3-9563-d452edd4d5f1","html_url":"https://github.com/pumpncode/fresh-plugin-svg-inject","commit_stats":null,"previous_names":["pumpncode/fresh-plugin-svg-inject"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/pumpncode/fresh-plugin-svg-inject","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumpncode%2Ffresh-plugin-svg-inject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumpncode%2Ffresh-plugin-svg-inject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumpncode%2Ffresh-plugin-svg-inject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumpncode%2Ffresh-plugin-svg-inject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pumpncode","download_url":"https://codeload.github.com/pumpncode/fresh-plugin-svg-inject/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pumpncode%2Ffresh-plugin-svg-inject/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29817840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","fresh","fresh-plugin"],"created_at":"2025-03-17T08:35:03.212Z","updated_at":"2026-02-25T10:34:10.485Z","avatar_url":"https://github.com/pumpncode.png","language":"JavaScript","funding_links":["https://github.com/sponsors/pumpncode","https://github.com/sponsors/nnmrts"],"categories":[],"sub_categories":[],"readme":"# fresh-plugin-svg-inject\n\nThis is a plugin for [fresh](https://github.com/denoland/fresh) that injects SVGs referenced in `img` tags into the rendered html text.\n\nIt turns this:\n\n```html\n\u003c!-- generated html of your component --\u003e\n\u003cimg\n\tsrc=\"assets/logo.svg\"\n\tclass=\"h-full\"\n/\u003e\n```\n\n```html\n\u003c!-- ./assets/logo.svg --\u003e\n\u003csvg\n\txmlns=\"http://www.w3.org/2000/svg\"\n\tviewBox=\"0 0 3000 3500\"\n\tclass=\"h-full\"\n\u003e\n\t\u003cdefs\u003e\n\t\t\u003crect\n\t\t\tid=\"box\"\n\t\t\twidth=\"100%\"\n\t\t\theight=\"100%\"\n\t\t/\u003e\n\t\u003c/defs\u003e\n\n\t\u003cuse href=\"#box\" /\u003e\n\u003c/svg\u003e\n```\n\ninto this:\n\n```html\n\u003c!-- html with svg injected into it --\u003e\n\u003csvg\n\txmlns=\"http://www.w3.org/2000/svg\"\n\tviewBox=\"0 0 3000 3500\"\n\tclass=\"h-full\"\n\u003e\n\t\u003cdefs\u003e\n\t\t\u003crect\n\t\t\tid=\"box-inject1\"\n\t\t\twidth=\"100%\"\n\t\t\theight=\"100%\"\n\t\t/\u003e\n\t\u003c/defs\u003e\n\n\t\u003cuse href=\"#box-inject1\" /\u003e\n\u003c/svg\u003e\n```\n\nbefore your site gets served.\n\nThe ids are renamed to avoid collisions. This plugin is in essence a modern, less sophisticated port of [iconfu/svg-inject](https://github.com/iconfu/svg-inject) for fresh.\n\n## Usage\n\n```js\nimport tailwind from \"$fresh/plugins/tailwind.ts\";\nimport svgInjectPlugin from \"https://deno.land/x/fresh_plugin_svg_inject/main.js\";\nimport { defineConfig } from \"$fresh/server.ts\";\n\nexport default defineConfig({\n\tplugins: [\n\t\ttailwind(),\n\t\tsvgInjectPlugin()\n\t]\n});\n```\n\nYou can also pass an options object to `svgInjectPlugin()` with a single `staticFolder` option, which should be the same as the `staticDir` option specified on the fresh config. Default is `\"./static\"` and I know this should be read automatically but I have no idea how; contributions are welcome.\n\n## Contributing\n\nWe appreciate your help! To contribute, please read our [contributing instructions](./contributing.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpumpncode%2Ffresh-plugin-svg-inject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpumpncode%2Ffresh-plugin-svg-inject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpumpncode%2Ffresh-plugin-svg-inject/lists"}