diff --git a/apps/ottabase-template-app-nextjs-homepage/README.md b/apps/ottabase-template-app-nextjs-homepage/README.md index ed44fc089..dc515d941 100644 --- a/apps/ottabase-template-app-nextjs-homepage/README.md +++ b/apps/ottabase-template-app-nextjs-homepage/README.md @@ -304,3 +304,14 @@ CI/CD is handled by the shared `.github/workflows/deploy.yml` — deploys on pus The workflow reads `cloudflare-config.json` from each app folder to determine app type (`nextjs`), build commands, output paths and wrangler config — no hardcoded names in yml. + +## Dynamic Marketing Pages (Worker-driven) + +In addition to static homepage slots, the app now supports dynamic route rendering from the TanStack Worker API: + +- Route: `app/[slug]/page.tsx` +- Data source: `GET {NEXT_PUBLIC_TANSTACK_API_URL}/api/pages/:slug` +- Nav prebuild: `GET .../api/pages/nav` in `generateStaticParams()` +- Draft preview: append `?preview=true` + +Set `NEXT_PUBLIC_TANSTACK_API_URL` in `.env.local` when homepage and worker run on different hosts. diff --git a/apps/ottabase-template-app-nextjs-homepage/app/[slug]/marketing-page-content.tsx b/apps/ottabase-template-app-nextjs-homepage/app/[slug]/marketing-page-content.tsx new file mode 100644 index 000000000..89ee66487 --- /dev/null +++ b/apps/ottabase-template-app-nextjs-homepage/app/[slug]/marketing-page-content.tsx @@ -0,0 +1,38 @@ +import { SlotRendererStatic } from '../../components/SlotRenderer'; + +export function MarketingPageContent({ page }: { page: any }) { + return ( +
{section.body}
: null} ++ End-to-end builder with sortable blocks, features and actions. +
+{section.slot}
++ {section.variant} • {section.enabled ? 'enabled' : 'disabled'} +
+Select a block from the canvas to edit.
+ ) : ( + <> +Features
+ +Actions
+ +Create landing pages with reusable blocks.
+/{page.slug}
+{page.status}
+{section.subtitle}
: null} + {section.body ?{section.body}
: null} + {section.features?.length ? ( +