A Cloudflare worker script to add attributes of a .svg file from a URL It's useful when customizing themes of self-hosted homepages such as Dashy if you want to add some icons which are not from the supported icon library
There are 2 options
A ready-to-use Cloudflare worker has already been deployed at https://svg-rewriter.oasistem.com
Limitation: The maximum number of requests for this service is limited to 10000/day
To change the color of Tsubame emblem of Tokyo Institute of Technology to TiTech theme color #052D5D, just
https://svg-rewriter.oasistem.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2FSYSTEMG2000%2FUser_Repo%2Fmain%2FIcon%2FTiTech_Icon.svg&fill=%23052d5d
Note: You can use an encoding tool to encode the url in your request.
- Download "index.js" from this repository.
- Register a free Cloudflare account.
- Go to "Workers & Pages" from the dashboard, then "Create application".
- Choose "Pages" - "Upload assets", then upload the .js file.
- (Optional) A custom domain could be given to the page if you own one.