Skip to content

bluwy/sponsors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 <svg></svg> 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:

SPONSORS_GIST=<ssh_url>

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 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.
  2. The default git branch is master.

Sponsors

Sponsors

License

MIT

About

A zero-dependencies script to generate sponsors SVG from Patreon

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project