Skip to content

Commit

Permalink
Add donation badge to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
evilaliv3 committed Sep 22, 2024
1 parent 5b864fa commit fd48877
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
25 changes: 25 additions & 0 deletions documentation/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,28 @@ vertical li.current > a {
max-width: 100%;
}
}

.donation-banner {
background-color: #fff;
padding: 10px;
text-align: center;
width: 100%;
position: fixed;
top: 0;
z-index: 1000;
}

.donation-banner a {
font-weight: bold;
}

.donation-icon {
width: 30px;
height: 30px;
vertical-align: middle;
margin-right: 10px;
}

body {
padding-top: 50px; /* To avoid content overlap */
}
6 changes: 6 additions & 0 deletions documentation/_static/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
document.addEventListener("DOMContentLoaded", function() {
var banner = document.createElement("div");
banner.className = 'donation-banner';
banner.innerHTML = '<img src="https://raw.githubusercontent.com/globaleaks/whistleblowing-software/main/brand/assets/heart.svg" class="donation-icon" alt="Donate" /> Globaleaks is free and open-source whistleblowing software. <a href="https://github.com/sponsors/globaleaks">Donate here to support its development!</a>';
document.body.insertBefore(banner, document.body.firstChild);
});
1 change: 1 addition & 0 deletions documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@

def setup(app):
app.add_css_file("custom.css")
app.add_js_file("custom.js")

0 comments on commit fd48877

Please sign in to comment.