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: 0 additions & 3 deletions bun.lock

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

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "datamart-web",
"version": "0.2.0",
"version": "0.2.1",
"private": true,
"description": "datamart.help: public libraries, schools, colleges and government services near you, with the source of every fact",
"license": "MIT",
Expand All @@ -15,7 +15,6 @@
"smoke": "bun scripts/smoke.ts"
},
"dependencies": {
"@profullstack/footer": "latest",
"hono": "4.13.12",
"next": "16.3.8",
"react": "19.2.3",
Expand Down
4 changes: 2 additions & 2 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ dl.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 52rem) { .split { grid-template-columns: 2fr 1fr; } }

.site-footer { border-top: 1px solid var(--line); padding: 1.5rem 0 0.5rem; color: var(--muted); font-size: 0.85rem; }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.site-footer + div > .pfs-footer { border-top: 0; }

/* CrawlProof ad unit: no box until ad.js starts filling it, so an unsold or blocked slot leaves no hole. */
.ad-unit { display: flex; flex-direction: column; align-items: center; height: 0; overflow: hidden; }
Expand Down
32 changes: 15 additions & 17 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { Metadata, Viewport } from "next";
import { Footer } from "@profullstack/footer/react";
import Link from "next/link";
import { AdUnit } from "@/components/ad-unit";
import { PitFooter } from "@/components/pit-footer";
import { RegisterServiceWorker } from "@/components/register-sw";
import { DISCLOSURE } from "@/lib/site";
import "./globals.css";

// Pages prerender at build; revalidating hourly lets the shared footer pick up a new
// @profullstack/footer template (served from jsDelivr @latest) without a redeploy.
// Pages prerender at build; revalidating hourly lets the pit.world footer
// (fetched server side from pit.world/snippets/footer.html) refresh without a redeploy.
export const revalidate = 3600;

export const metadata: Metadata = {
Expand Down Expand Up @@ -64,25 +64,23 @@ export default function RootLayout({ children }: { children: React.ReactNode })
</nav>
</div>
</header>
<main id="main" className="wrap">{children}</main>
<div className="wrap">
<main id="main" className="wrap">
<AdUnit />
</div>
<div className="site-footer">
{children}
</main>
<footer className="site-footer">
<div className="wrap">
<nav aria-label="Footer">
<span>&copy; {new Date().getFullYear()} Profullstack, Inc.</span>
<Link href="/about">About</Link>
<Link href="/developers">API and MCP</Link>
<a href="https://github.com/profullstack/datamart.help">Source</a>
</nav>
<p>{DISCLOSURE}</p>
</div>
</div>
<Footer
site="https://datamart.help/"
links={[
{ label: "About", href: "/about" },
{ label: "API and MCP", href: "/developers" },
{ label: "Finance", href: "/finance" },
{ label: "Source", href: "https://github.com/profullstack/datamart.help" },
]}
/>
</footer>
<RegisterServiceWorker />
<PitFooter />
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ad-unit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ declare global {
}

/**
* One CrawlProof unit above the footer. The aside is server-rendered without
* One CrawlProof unit at the top of the content. The aside is server-rendered without
* data-slot, so ad.js's own DOMContentLoaded pass skips it; the format is picked
* from the real viewport on mount, then we ask ad.js to scan (retrying briefly
* until it has loaded, and giving up so an ad blocker leaves no timer running).
Expand Down
17 changes: 17 additions & 0 deletions src/components/pit-footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const PIT_FOOTER_URL = "https://pit.world/snippets/footer.html?site=datamart.help";

/**
* The pit.world network footer, fetched server side (cached an hour, 3s timeout).
* Any failure renders nothing, so pit.world being down never breaks a page.
*/
export async function PitFooter() {
try {
const res = await fetch(PIT_FOOTER_URL, { next: { revalidate: 3600 }, signal: AbortSignal.timeout(3000) });
if (!res.ok) return null;
const html = await res.text();
if (!html.includes("data-pit-footer")) return null;
return <div dangerouslySetInnerHTML={{ __html: html }} />;
} catch {
return null;
}
}
Loading