Skip to content

Commit ae2ae89

Browse files
authored
Merge pull request #5 from Astro-Craft-Theme/feat/8bitquest-contact-page
feat: add Resend-backed Contact page from Figma (node 9:4)
2 parents c641279 + c4edf08 commit ae2ae89

18 files changed

Lines changed: 953 additions & 6 deletions

File tree

.claude/rules/seo.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,11 @@ When the route lands, these three come with it (**deliberately not built** until
120120

121121
## The check
122122

123-
`pnpm build`, then confirm the artifacts in `dist/` (a fully static build — no adapter, so the tree
124-
is flat, not `dist/client/`): valid JSON-LD in the HTML `<head>` (a `@graph` with matching `@id`s),
123+
`pnpm build`, then confirm the artifacts in `dist/`. The build is static **except one route**:
124+
`/contact/` sets `export const prerender = false` (it takes the Resend form POST and re-renders with
125+
the result), so `@astrojs/node` is mounted and the prerendered tree now lands in **`dist/client/`**
126+
(with the one server entry in `dist/server/`), not a flat `dist/`. Everything below still holds —
127+
just look under `dist/client/`: valid JSON-LD in the HTML `<head>` (a `@graph` with matching `@id`s),
125128
`robots.txt` + `llms.txt` with absolute URLs, and `sitemap-0.xml` listing only indexable,
126129
trailing-slash URLs. The JSON-LD builders carry a runnable self-check: `pnpm test` (or directly:
127130
`node --experimental-strip-types src/js/schema.test.ts`).

astro.config.mjs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// @ts-check
22
import mdx from "@astrojs/mdx";
3+
import node from "@astrojs/node";
34
import sitemap from "@astrojs/sitemap";
45
import tailwindcss from "@tailwindcss/vite";
56
import { defineConfig } from "astro/config";
@@ -30,16 +31,30 @@ if (isProductionDeploy && site.includes("example.com")) {
3031
export default defineConfig({
3132
site,
3233

34+
// The site is static EXCEPT one page: `/contact/` sets `export const prerender = false` because
35+
// it receives the Resend form POST and re-renders itself with the result (the grafio pattern).
36+
// That single on-demand route is the only thing this Node server ever runs; every other route
37+
// still prerenders to HTML. `mode: "standalone"` emits a self-contained Node server (dist/server +
38+
// dist/client) that fits the Dokploy/Traefik/Docker setup this project deploys behind — swap it for
39+
// `@astrojs/netlify` / `@astrojs/vercel` in two lines if the host changes (nothing else knows which
40+
// adapter is mounted). Drop the contact form and remove this line to go fully static again.
41+
adapter: node({ mode: "standalone" }),
42+
3343
// One canonical URL shape: the directory build emits trailing slashes, and canonical + OG agree
3444
// on that shape (see .claude/rules/seo.md).
3545
trailingSlash: "always",
3646

3747
// mdx() renders .mdx content.
3848
// sitemap filter: never list noindex pages — the dev-only /examples catalog and 404s
3949
// both set `noindex` in the markup, so a sitemap entry for them would contradict it.
50+
// customPages: the sitemap can't enumerate the on-demand `/contact/` route (it emits no static
51+
// file), so it's added by hand — the one manual entry seo.md prescribes for SSR routes.
4052
integrations: [
4153
mdx(),
42-
sitemap({ filter: (page) => !page.includes("/examples/") && !page.includes("/404/") }),
54+
sitemap({
55+
filter: (page) => !page.includes("/examples/") && !page.includes("/404/"),
56+
customPages: [new URL("/contact/", site).href],
57+
}),
4358
],
4459

4560
vite: {

cj2.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Netscape HTTP Cookie File
2+
# https://curl.se/docs/http-cookies.html
3+
# This file was generated by libcurl! Edit at your own risk.
4+

g.html

Lines changed: 35 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
},
1919
"dependencies": {
2020
"@astrojs/mdx": "^7.0.3",
21+
"@astrojs/node": "^11.0.2",
2122
"@astrojs/sitemap": "^3.7.3",
2223
"@fontsource/press-start-2p": "^5.3.0",
2324
"@fontsource/space-mono": "^5.3.0",

0 commit comments

Comments
 (0)