https://github.com/bluwy/sponsors
Personal tool to generate sponsors SVG
https://github.com/bluwy/sponsors
patreon sponsors
Last synced: 3 months ago
JSON representation
Personal tool to generate sponsors SVG
- Host: GitHub
- URL: https://github.com/bluwy/sponsors
- Owner: bluwy
- License: mit
- Created: 2022-04-24T12:48:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2025-03-04T17:02:57.000Z (8 months ago)
- Last Synced: 2025-04-02T10:51:22.914Z (7 months ago)
- Language: JavaScript
- Homepage: https://bjornlu.com/sponsors.svg
- Size: 128 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sponsors
Using https://github.com/antfu/sponsorkit
## Usage
```
pnpm i
pnpm gen
```
## Serving the SVG
The `gist.sh` script uses GitHub gist as a static file host. Go to https://gist.github.com and create a public gist. Give any description and create a `sponsors.svg` file with `` as the content (temporary only). Click on the `embed` button, change to `Clone via SSH`, and take note of the SSH URL.
Update the `.env` file with the SSH URL:
```ini
SPONSORS_GIST=
```
Make sure there's an existing `sponsorkit/sponsors.svg` file locally before continuing to the next step.
To update the `sponsors.svg` file of the gist, run `pnpm gist`. It will create a temporary `gist` folder, copy over the `sponsors.svg` file, and force push to the remote gist to ensure only one commit exists.
Now you can access the SVG file with a URL like https://gist.github.com/user/gist_id/raw/sponsors.svg. Serving directly from this endpoint is not ideal as GitHub doesn't send the proper `Content-Type`, for me I've set a [custom proxy](https://github.com/bluwy/website/blob/master/src/routes/sponsors.svg.js) to acheive so. There are options like http://raw.githack.com but it's `Cache-Control` is too long.
> Note: The guide has the following assumptions:
>
> 1. You have set up SSH. See [GitHub docs](https://docs.github.com/en/authentication/connecting-to-github-with-ssh).
> 2. The default git branch is `master`.
## Sponsors
## License
MIT