diff --git a/website/app/page.ts b/website/app/page.ts index 260059920..71ed19c02 100644 --- a/website/app/page.ts +++ b/website/app/page.ts @@ -2,7 +2,8 @@ import { html } from '@webjsdev/core'; import '#components/copy-cmd.ts'; import '#components/like-button.ts'; import { COMPONENT_SAMPLE, ACTION_SAMPLE, PAGE_SAMPLE } from '#lib/samples.ts'; -import { DOCS_URL, UI_URL, EXAMPLE_BLOG_URL, GH_URL, DISCORD_URL, NEW_TAB } from '#lib/links.ts'; +import { DOCS_URL, GH_URL, NEW_TAB } from '#lib/links.ts'; +import { siteFooter } from '#lib/site-footer.ts'; // highlight() runs only at SSR (codeWindow renders its output into the served // HTML), but it does ship to the client as a small dead module: the page loads // in the browser to register copy-cmd, and that pulls in its @@ -400,47 +401,6 @@ middleware.ts - + ${siteFooter()} `; } diff --git a/website/app/why/page.ts b/website/app/why/page.ts index 581163900..56fcea097 100644 --- a/website/app/why/page.ts +++ b/website/app/why/page.ts @@ -1,6 +1,7 @@ import { html } from '@webjsdev/core'; import '#components/copy-cmd.ts'; import { DOCS_URL, GH_URL, EXAMPLE_BLOG_URL, NEW_TAB } from '#lib/links.ts'; +import { siteFooter } from '#lib/site-footer.ts'; /** * /why @@ -211,5 +212,7 @@ Counter.register('counter'); + + ${siteFooter()} `; } diff --git a/website/lib/site-footer.ts b/website/lib/site-footer.ts new file mode 100644 index 000000000..cd6b66342 --- /dev/null +++ b/website/lib/site-footer.ts @@ -0,0 +1,59 @@ +import { html } from '@webjsdev/core'; +import { DOCS_URL, UI_URL, EXAMPLE_BLOG_URL, GH_URL, DISCORD_URL, NEW_TAB } from '#lib/links.ts'; + +/** + * The site-wide footer, shared across marketing pages (the home page and /why). + * + * It lives here rather than inline in a page so every page renders the same + * chrome. Pure SSR-time helper: it returns an `html` fragment and touches no + * client globals, so importing it never ships a page to the browser. + * + * Anchor links point at `/#` (not a bare `#`) so a section anchor + * resolves from any page, not only the home page. + */ +export function siteFooter() { + return html` + + `; +}