Setting up a "Sponsor this project" section on GitHub allows others to support your open source project through sponsorship. Here are the steps to set up sponsorship options:
1. Enable GitHub Sponsors
Make sure your account and repository are in a region that supports GitHub Sponsors. You can visit the GitHub Sponsors page to learn more and apply to join.
2. Create FUNDING.yml file
In your project repository, you need to create a .github/FUNDING.yml
file named . This file should be located .github
inside a folder named , which should be located at the root of the repository.
3. Add Sponsored Links
In FUNDING.yml
the file, you can add various sponsored links. For example:
github: [你的GitHub用户名]
patreon: 你的Patreon用户名
open_collective: 你的OpenCollective用户名
ko_fi: 你的Ko-fi用户名
tidelift: 你的Tidelift项目链接
community_bridge: 你的CommunityBridge项目链接
liberapay: 你的Liberapay用户名
issuehunt: 你的IssueHunt用户名
otechie: 你的Otechie用户名
custom: ['任何自定义赞助链接']
4. Commit and push files
Save the file and commit it to your repository. On the repository page on GitHub, you should now see a "Sponsor" button.
5. Add sponsorship badges (optional)
If you want to add a sponsored badge to your README or project page, you can use the following Markdown code:
[![Sponsor](https://img.shields.io/badge/Sponsor-%E2%9D%A4-red)](你的赞助链接)
Summarize
Through the above steps, you can add a "Sponsor this project" section to your GitHub project, allowing others to sponsor your project through different channels. This is very useful for supporting and promoting the sustainable development of open source projects.