The Codeberg Documentation website is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
It bundles third-party font software licensed under a different license. Please look at the LICENSE file for details.
Changes to the original versions of the article as well as its individual authors can be looked up in this article's commit history
Codeberg and the Codeberg Logo are trademarks of Codeberg e.V.
This article will guide you through integrating your Codeberg's projects with Liberapay, a platform that helps open-source developers receive donations.
After signing up for an account and setting up all the necessary financial information, you will be able to use widgets.
Widgets are small icons that can be used in places like Markdown documents. In the context of Liberapay, you can use widgets to:
After clicking on the Widgets button, you should be able to see a page full of the widgets that Liberapay provides!
In order to embed a widget in a Markdown document using Markdown itself, we will take a few extra steps in the following section.
Markdown documents are not limited to repositories (such as README.md
files). Codeberg is an instance of Forgejo, and Forgejo lets you use Markdown on README files, your profile's biography, as well as an organization's description.
In the following steps, we will show you how to convert the HTML code displayed on Liberapay's website into Markdown. As an example, we will use the "Donation Button" widget for the user Codeberg
; make sure to replace Codeberg
with your own username!
The HTML code for the widget should look like this:
<script src="https://liberapay.com/Codeberg/widgets/button.js"></script>
<noscript
><a href="https://liberapay.com/Codeberg/donate"
><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg" /></a
></noscript>
There are two URLs that we can extract from that code:
https://liberapay.com/Codeberg/donate
https://liberapay.com/assets/widgets/donate.svg
Using these two URLs, we can embed that widget in Markdown format using the following Markdown code:
[![LiberaPay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/Codeberg/donate)
Since this document is authored in Markdown (and rendered to HTML), we can just use that code to show how the final result will look like:
In case you are unfamiliar with Markdown links, they look like this: [Example Link](https://example.com)
To embed an image, you can include its link and prepend an exclamation mark: ![Example Icon](https://example.com/icon.svg)
By combining the two, we can embed an image and make it link to an external page when clicked: [![Example Icon](https://example.com/icon.svg)](https://example.com)
Liberapay also offers shields.io widgets, which are more dynamic than the simple "Donation Button" widget. They can be found at the bottom of the Widgets page.
shields.io also provides its own documentation for Liberapay icons:
An example on including these badges in Markdown will follow. To use them, you will need to replace {desired badge}
with one of the four options:
gives
goal
patrons
receives
(Don't forget to replace Codeberg
with your own username!)
[![LiberaPay](https://img.shields.io/liberapay/{desired badge}/Codeberg.svg?logo=liberapay)](https://liberapay.com/{your username}/donate)
For clarity's sake, this is how the code for the receives
widget should look like for the user Codeberg
...
[![LiberaPay](https://img.shields.io/liberapay/receives/codeberg.svg?logo=liberapay")](https://liberapay.com/codeberg/donate)
... and this is how the final result should look like:
As mentioned before, it is currently possible to include Liberapay badges in profiles and organizations by embedding the Markdown code in descriptions.
For more information on profile customization, take a look at the "Profile customization" in Forgejo's documentation.
Hey there! 👋 Thank you for reading this article!
Is there something missing, or do you have an idea on how to improve the documentation? Do you want to write your own article?
You're invited to contribute to the Codeberg Documentation at its source code repository, for example, by adding a pull request or joining in on the discussion in the issue tracker.
For an introduction on contributing to Codeberg Documentation, please have a look at the Contributor FAQ.
© Codeberg Docs Contributors. See LICENSE