Skip to content

Commit fef2daf

Browse files
TMHSDigitalclaude
andcommitted
Add GitHub Sponsors: README badge and Support line, FUNDING.yml, site footer button and homepage card
Site embeds come from sponsorButtonHtml/sponsorCardHtml in site/lib/shared.mjs, used by the entry, stack and freshness page footers and the index.html footer (button on every page, card on the homepage only; card is max-width: 100%). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 82d7d8d commit fef2daf

9 files changed

Lines changed: 33 additions & 2 deletions

File tree

‎.github/FUNDING.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [TMHSDigital]

‎README.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[![License: CC0-1.0](https://img.shields.io/badge/license-CC0--1.0-lightgrey.svg)](LICENSE)
88
[![Sources](https://img.shields.io/badge/sources-377-informational)](https://tmhsdigital.github.io/Free-Game-Dev-Assets/)
99
[![GitHub stars](https://img.shields.io/github/stars/TMHSDigital/Free-Game-Dev-Assets)](https://github.com/TMHSDigital/Free-Game-Dev-Assets/stargazers)
10+
[![Sponsor](https://img.shields.io/badge/Sponsor-TMHSDigital-ea4aaa?logo=githubsponsors&logoColor=white)](https://github.com/sponsors/TMHSDigital)
1011
[![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
1112

1213
Free assets and tools for commercial games. Each entry records the licence as its source
@@ -320,6 +321,10 @@ npm run serve # preview at http://localhost:3000
320321

321322
</details>
322323

324+
## Support
325+
326+
If the catalog saves you time, you can [sponsor TMHSDigital on GitHub](https://github.com/sponsors/TMHSDigital). Entirely optional.
327+
323328
## License
324329

325330
Catalog metadata and documentation in this repository are dedicated to the public domain

‎site/build.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import fs from "node:fs";
77
import path from "node:path";
88
import { fileURLToPath } from "node:url";
9-
import { commercialLabel, esc, latestAllowedDate, MAINTENANCE_NOTES, PERSPECTIVE_LABELS, verifiedAge } from "./lib/shared.mjs";
9+
import { commercialLabel, esc, latestAllowedDate, MAINTENANCE_NOTES, PERSPECTIVE_LABELS, sponsorButtonHtml, sponsorCardHtml, verifiedAge } from "./lib/shared.mjs";
1010
import { parseFrontmatter, summaryFromBody } from "./lib/frontmatter.mjs";
1111
import { entryPageHtml } from "./lib/entry-page.mjs";
1212
import { LinkError, makeLinkResolver } from "./lib/links.mjs";
@@ -593,6 +593,8 @@ function main() {
593593
GUIDE_ROWS: guideRowsHtml(config.guides, repoUrl),
594594
CATALOG_BLURB: `${stats.total} sources &middot; ${stats.active} active &middot; ${stats.commercialOk} commercial-ok &middot; ${stats.commercialVaries} per-file &middot; ${stats.deprecated} deprecated`,
595595
RESULT_COUNT: `${visible.length} of ${stats.total} entries shown`,
596+
SPONSOR_BUTTON: sponsorButtonHtml(),
597+
SPONSOR_CARD: sponsorCardHtml(),
596598
FOOTER_STAMP: `Built ${esc(stamp)} from ${stats.total} catalog entries.`,
597599
};
598600
let html = fs.readFileSync(indexPath, "utf8");

‎site/lib/entry-page.mjs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
PERSPECTIVE_LABELS,
88
STATUS_NOTES,
99
verifiedAge,
10+
sponsorButtonHtml,
1011
} from "./shared.mjs";
1112

1213
export function jsonLd(entry, site) {
@@ -167,6 +168,7 @@ export function entryPageHtml({ entry, leadHtml, restHtml, deprecatedReasonHtml,
167168
<footer class="footer">
168169
<p>Catalog metadata is CC0. Linked assets keep their own licenses: re-check the live source before shipping.</p>
169170
<p><a href="../../freshness/">Licence freshness</a></p>
171+
<p class="footer-sponsor">${sponsorButtonHtml()}</p>
170172
<p class="footer-stamp">Built ${esc(stamp)} from ${total} catalog entries.</p>
171173
</footer>
172174
<script src="../../entry.js" defer></script>

‎site/lib/freshness.mjs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Buckets come from verifiedAge, the function the homepage cards use, so the
44
* summary and the cards cannot disagree. Pure: `now` is passed in.
55
*/
6-
import { esc, freshnessPageUrl, verifiedAge } from "./shared.mjs";
6+
import { esc, freshnessPageUrl, sponsorButtonHtml, verifiedAge } from "./shared.mjs";
77

88
const RECENT_DAYS = 30;
99
const byName = (a, b) => a.entry.name.localeCompare(b.entry.name);
@@ -145,6 +145,7 @@ export function freshnessPageHtml({ stats, site, stamp, total, hasCard }) {
145145
</main>
146146
<footer class="footer">
147147
<p>Catalog metadata is CC0. Linked assets keep their own licenses: re-check the live source before shipping.</p>
148+
<p class="footer-sponsor">${sponsorButtonHtml()}</p>
148149
<p class="footer-stamp">Built ${esc(stamp)} from ${total} catalog entries.</p>
149150
</footer>
150151
</body>

‎site/lib/shared.mjs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,12 @@ export function stackPageUrl(site, id) {
9393
export function freshnessPageUrl(site) {
9494
return `${String(site.siteUrl).replace(/\/+$/, "")}/freshness/`;
9595
}
96+
97+
/** GitHub Sponsors embeds. Iframes are fine on the site; GitHub strips them from the README. */
98+
export function sponsorButtonHtml() {
99+
return '<iframe class="sponsor-button" src="https://github.com/sponsors/TMHSDigital/button" title="Sponsor TMHSDigital" height="32" width="114" style="border: 0; border-radius: 6px;"></iframe>';
100+
}
101+
102+
export function sponsorCardHtml() {
103+
return '<iframe class="sponsor-card" src="https://github.com/sponsors/TMHSDigital/card" title="Sponsor TMHSDigital" height="225" width="600" style="border: 0; max-width: 100%;"></iframe>';
104+
}

‎site/lib/stack-page.mjs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
STATUS_NOTES,
88
stackPageUrl,
99
verifiedAge,
10+
sponsorButtonHtml,
1011
} from "./shared.mjs";
1112
import { copyAllText } from "./stacks.mjs";
1213

@@ -165,6 +166,7 @@ export function stackPageHtml({ stack, sections, gapsHtml, leadHtml, owed, site,
165166
<footer class="footer">
166167
<p>Catalog metadata is CC0. Linked assets keep their own licenses: re-check the live source before shipping.</p>
167168
<p><a href="../../freshness/">Licence freshness</a></p>
169+
<p class="footer-sponsor">${sponsorButtonHtml()}</p>
168170
<p class="footer-stamp">Built ${esc(stamp)} from ${total} catalog entries.</p>
169171
</footer>
170172
${script}

‎site/public/index.html‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ <h2 id="guides-title">Guides</h2>
209209
· add entries from <code>catalog/TEMPLATE.md</code>
210210
</p>
211211
<p><a href="freshness/">Licence freshness</a></p>
212+
<p class="footer-sponsor"><!--SPONSOR_BUTTON--></p>
213+
<div class="footer-sponsor-card"><!--SPONSOR_CARD--></div>
212214
<p class="footer-stamp"><!--FOOTER_STAMP--></p>
213215
</footer>
214216

‎site/public/styles.css‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,13 @@ input:focus-visible,
782782
color: var(--muted);
783783
}
784784

785+
.footer-sponsor iframe,
786+
.footer-sponsor-card iframe {
787+
display: block;
788+
max-width: 100%;
789+
color-scheme: normal;
790+
}
791+
785792
.footer-stamp {
786793
font-family: var(--mono);
787794
font-size: 0.75rem;

0 commit comments

Comments
 (0)