Skip to content

Support FUNDING.yml to show sponsors button #26073

Open
@GreenImp

Description

Feature Description

GitHub allows adding a "Sponsor" button to repositories, user profiles and organisation pages, which takes the user to a page where they can sponsor the project.

I think this is quite important for open source projects that may be struggling to find time for the dev work, or lacking funding that they need.

It would be really nice if Gitea could do the same.

Desired functionality

Allow users / devlopers to specify funding sources and have a "Sponsor" button show on on a repository page, user profile, or organisation page.

When a user clicks the button, the user should be taken to the specified funding website.

If multiple funding sources are specified, then a dialogue should be shown to allow the user to choose which funding website to visit.

Adding a button

Add button to repository

On GitHub, to add a Sponsor button to a repository, you can add a .github/FUNDING.yml file with a list of available funding options to the repository.

An example can be seen on Gitea's own repo: https://github.com/go-gitea/gitea/blob/a12a5f3652c339b17b187ff424a480631a3c1e1e/.github/FUNDING.yml

And then you need to enable "Sponsorships" in the repository settings.

It would be good if we could do the same in Gitea, using an identically formatted FUNDING.yml file, but in the .gitea directory.

I think the need to also enable it in the repository settings is also good. Otherwise it would show the Sponsor button on forked repos, which may not be desirable.

Add button to user profile

On GitHub, the sponsor button on user profiles only seems to show a button linking to GitHub's own sponsor system.

Obviously Gitea doesn't have anything like this. However, with the new .profile repository functionality, I wonder if we could check if that repo exists for the user and, if so check for a .gitea/FUNDING.yml file. If it exists, use it to display a sponsor button.

Add button to organisation page

I'm not sure if organisations can have a .profile repository as well but, if so, then it would be good to have it on an organisation's profile / home page as well.

Screenshots

Example of the "Sponsor" button on a GitHub profile:

Screenshot from 2023-07-23 19-01-14

Example of the "Sponsor" button on a GitHub organisation page:

Screenshot from 2023-07-23 19-05-09

Example of the "Sponsor" button on a repository page:

Screenshot from 2023-07-23 19-03-02

Example of the modal shown on GitHub if FUNDING.yml contains multiple options:

Screenshot from 2023-07-23 19-08-19

Example of the "Sponsor" button shown at the bottom of the "issues" page:

Screenshot from 2023-07-23 19-11-00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions