Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"dependencies": {
"@profullstack/auth-system": "^0.8.3",
"@profullstack/emailer": "^1.0.3",
"@profullstack/footer": "latest",
"@profullstack/hqtui": "^0.10.3",
"@profullstack/player": "^0.14.0",
"jsonwebtoken": "^9.0.2",
Expand Down
26 changes: 21 additions & 5 deletions src/server/footer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
// The pit.world network footer, fetched server side from
// https://pit.world/snippets/footer.html and rendered into the
// <!--pit-footer--> markers of index.html on every page load. It refetches at
// most hourly with a 3-second timeout; on failure it keeps the last good copy,
// or renders nothing, so pit.world being down never breaks the page.
// Two footers render into index.html's markers on every page load:
//
// - <!--pfs-footer-->: the shared Profullstack footer (@profullstack/footer,
// copyright + webring) from the @latest template on jsDelivr (cached an hour
// by the package; the bundled template if the CDN is down).
// - <!--pit-footer-->: the pit.world network footer, fetched server side from
// https://pit.world/snippets/footer.html, last in the page. It refetches at
// most hourly with a 3-second timeout; on failure it keeps the last good
// copy, or renders nothing, so pit.world being down never breaks the page.
import { footerHtml } from '@profullstack/footer';

const RING_OPTIONS = { site: 'https://hdtilt.com/' };
const RING_REGION = /<!--pfs-footer-->[\s\S]*?<!--\/pfs-footer-->/;
const URL_ = 'https://pit.world/snippets/footer.html?site=hdtilt.com';
const TTL = 60 * 60 * 1000;
const REGION = /<!--pit-footer-->[\s\S]*?<!--\/pit-footer-->/;
Expand Down Expand Up @@ -33,6 +41,14 @@ function refresh() {

/** @param {string} html */
export async function withFooter(html) {
if (RING_REGION.test(html)) {
try {
const ring = await footerHtml(RING_OPTIONS);
html = html.replace(RING_REGION, () => `<!--pfs-footer-->${ring}<!--/pfs-footer-->`);
} catch {
// Leave the markers empty.
}
}
if (!REGION.test(html)) return html;
await refresh();
return html.replace(REGION, () => `<!--pit-footer-->${cached}<!--/pit-footer-->`);
Expand Down
14 changes: 4 additions & 10 deletions web/public/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ body.gated .nav-items button:not(#nav-account) {
min-width: 0;
}

/* Footer (own copyright row + the pit.world network footer): only while the
/* Footer (@profullstack/footer + the pit.world network footer): only while the
sheet is up, docked under it. */
.ring-dock {
display: none;
Expand All @@ -1102,15 +1102,9 @@ body.gated .nav-items button:not(#nav-account) {
display: block;
color: var(--text);
}
.site-foot {
margin: 0;
padding: 0.75rem 1rem 0;
text-align: center;
font-size: 0.85rem;
color: var(--dim);
}
.site-foot a {
color: inherit;
.ring-dock .pfs-footer {
--pfs-footer-muted: var(--dim);
border-top: 0;
}
/* The pit.world snippet is styled for light pages; this app is always dark. */
.ring-dock .pit-foot {
Expand Down
5 changes: 3 additions & 2 deletions web/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@
<div class="ad-dock"><aside id="cp-ad" class="cp-ad" data-cp-ad></aside></div>

<!-- Footer, shown under the setup/settings sheet, never over the picture. The
server renders the pit.world network footer between the markers. -->
<div class="ring-dock"><p class="site-foot">&copy; 2026 Profullstack, Inc. &middot; <a href="https://github.com/profullstack/hdtilt.com">Source</a></p><!--pit-footer--><!--/pit-footer--></div>
server renders @profullstack/footer (copyright + webring) and then the
pit.world network footer between the markers. -->
<div class="ring-dock"><!--pfs-footer--><!--/pfs-footer--><!--pit-footer--><!--/pit-footer--></div>
</div>
<script type="module" src="/app.js"></script>
<script src="https://crawlproof.com/ad.js" async></script>
Expand Down
Loading