From c8da4cb4ab19d6bf406ac3d1c82ce0054369c45f Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Mon, 19 Oct 2026 05:56:47 -0700 Subject: [PATCH] Add pit.world global footer, trim site footer (#246) Fetch https://pit.world/snippets/footer.html?site=logicsrc.com server-side (1h revalidate, 3s timeout, renders nothing on failure) as the last thing in . Replace the @profullstack/footer block (links row + webring row + copyright) with one row: copyright and the needed links. The network and ring links now come from the global footer. Co-authored-by: Claude Opus 5.5 --- .../contract/logicsrc-web.contract.test.ts | 12 +++-- apps/logicsrc-web/package.json | 2 +- apps/logicsrc-web/src/app/layout.tsx | 2 + .../src/components/pit-footer.tsx | 20 +++++++++ .../src/components/site-shell.tsx | 10 ++--- apps/logicsrc-web/src/lib/site-footer.ts | 44 ++++++++++--------- 6 files changed, 57 insertions(+), 33 deletions(-) create mode 100644 apps/logicsrc-web/src/components/pit-footer.tsx diff --git a/apps/logicsrc-web/contract/logicsrc-web.contract.test.ts b/apps/logicsrc-web/contract/logicsrc-web.contract.test.ts index a5fcfe25..2be5a46d 100644 --- a/apps/logicsrc-web/contract/logicsrc-web.contract.test.ts +++ b/apps/logicsrc-web/contract/logicsrc-web.contract.test.ts @@ -92,14 +92,12 @@ describe("server-rendered page markup", () => { expect(markup).toContain('id="project-request-form"'); }); - it("carries the Profullstack webring links (the ring verifier reads the homepage)", async () => { - process.env.PROFULLSTACK_FOOTER_OFFLINE = "1"; + it("carries the site footer (links + copyright), with no webring of its own", async () => { const markup = renderPageMarkup("/", await siteFooterHtml()); - expect(markup).toContain("data-pfs-footer"); - const from = "from=https%3A%2F%2Flogicsrc.com%2F"; - for (const hop of ["previous", "next", "random"]) { - expect(markup).toContain(`https://rssamplifier.com/ring/profullstack/${hop}?${from}`); - } + expect(markup).toContain('class="site-footer"'); + expect(markup).toContain('href="/terms"'); + expect(markup).toContain('href="/privacy"'); + expect(markup).not.toContain("rssamplifier.com/ring"); }); }); diff --git a/apps/logicsrc-web/package.json b/apps/logicsrc-web/package.json index 9a143a8a..81e03f3d 100644 --- a/apps/logicsrc-web/package.json +++ b/apps/logicsrc-web/package.json @@ -1,6 +1,6 @@ { "name": "@logicsrc/web", - "version": "0.1.0", + "version": "0.1.1", "private": true, "description": "LogicSRC standards and open specification PWA (Next.js).", "scripts": { diff --git a/apps/logicsrc-web/src/app/layout.tsx b/apps/logicsrc-web/src/app/layout.tsx index a6f6195b..353ea01c 100644 --- a/apps/logicsrc-web/src/app/layout.tsx +++ b/apps/logicsrc-web/src/app/layout.tsx @@ -3,6 +3,7 @@ import type { ReactNode } from "react"; import "../styles.css"; import Script from "next/script"; import { CopyButtons } from "@/components/copy-buttons"; +import { PitFooter } from "@/components/pit-footer"; import { PAGE_META, pageMetadata, SITE_URL } from "@/lib/page-meta"; const DESCRIPTION = PAGE_META["/"].description; @@ -86,6 +87,7 @@ export default function RootLayout({ children }: { children: ReactNode }): React src="https://crawlproof.com/stats.js" strategy="afterInteractive" /> + ); diff --git a/apps/logicsrc-web/src/components/pit-footer.tsx b/apps/logicsrc-web/src/components/pit-footer.tsx new file mode 100644 index 00000000..97821298 --- /dev/null +++ b/apps/logicsrc-web/src/components/pit-footer.tsx @@ -0,0 +1,20 @@ +/** + * The pit.world global footer, fetched server-side and cached for an hour. + * Renders nothing on any failure so it can never break the page. + */ +const PIT_FOOTER_URL = "https://pit.world/snippets/footer.html?site=logicsrc.com"; + +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
; + } catch { + return null; + } +} diff --git a/apps/logicsrc-web/src/components/site-shell.tsx b/apps/logicsrc-web/src/components/site-shell.tsx index ce6e60de..e6b32aa8 100644 --- a/apps/logicsrc-web/src/components/site-shell.tsx +++ b/apps/logicsrc-web/src/components/site-shell.tsx @@ -2,8 +2,7 @@ import type { ReactNode } from "react"; import { renderInstallCommand } from "@/lib/install-command"; import { Breadcrumbs } from "@/components/breadcrumbs"; import { SideNav } from "@/components/side-nav"; -import { Footer } from "@profullstack/footer/react"; -import { SITE_FOOTER, SITE_FOOTER_COLOR } from "@/lib/site-footer"; +import { SITE_FOOTER_COLOR, SITE_FOOTER_HTML } from "@/lib/site-footer"; /** * The site chrome for every standalone route: the sidebar that unfolds to @@ -39,9 +38,10 @@ export function SiteShell({
{children} -
-
-
+
); diff --git a/apps/logicsrc-web/src/lib/site-footer.ts b/apps/logicsrc-web/src/lib/site-footer.ts index 314e378b..84c509f3 100644 --- a/apps/logicsrc-web/src/lib/site-footer.ts +++ b/apps/logicsrc-web/src/lib/site-footer.ts @@ -1,26 +1,30 @@ -import { footerHtml, type FooterOptions } from "@profullstack/footer"; - /** - * The site footer: @profullstack/footer (links, copyright and the Profullstack - * webring). SiteShell renders it as the package's React server component; the - * homepage, which is the legacy markup string (lib/page-markup.ts), gets the same - * footer as HTML. Both render on the server, which is what the ring's verifier reads. + * The site footer: one row of links plus the copyright. The network links + * (pit.world, search, ring) come from the pit.world global footer, which the + * root layout appends to every page (components/pit-footer.tsx). + * SiteShell and the homepage markup string (lib/page-markup.ts) share this HTML. */ -export const SITE_FOOTER: FooterOptions = { - site: "https://logicsrc.com/", - links: [ - { label: "Specs", href: "/specs" }, - { label: "Docs", href: "/docs" }, - { label: "RSS", href: "/blog/rss.xml" }, - { label: "llms.txt", href: "/llms.txt" }, - { label: "Terms", href: "/terms" }, - { label: "Privacy", href: "/privacy" }, - ], -}; +const LINKS: Array<[string, string]> = [ + ["Specs", "/specs"], + ["Docs", "/docs"], + ["Blog", "/blog"], + ["RSS", "/blog/rss.xml"], + ["llms.txt", "/llms.txt"], + ["Code", "https://github.com/profullstack/logicsrc"], + ["Terms", "/terms"], + ["Privacy", "/privacy"], +]; -/** Muted text, as the old footer had; the package inherits `color`. */ +/** Muted text, as the old footer had. */ export const SITE_FOOTER_COLOR = "#5b6b7a"; -export function siteFooterHtml(): Promise { - return footerHtml(SITE_FOOTER); +export const SITE_FOOTER_HTML = + `
` + + `© ${new Date().getFullYear()} LogicSRC` + + `
`; + +export async function siteFooterHtml(): Promise { + return SITE_FOOTER_HTML; }