Marketing

Legal pages

Learn how to create and update legal pages

Legal pages are defined in the apps/web/src/app/(client)/(marketing)/legal directory.

TurboStarter comes with the following legal pages:

  • Terms and Conditions: to define the terms and conditions of your application
  • Privacy Policy: to define the privacy policy of your application
  • Cookie Policy: to define the cookie policy of your application

For obvious reasons, these pages are empty and you need to fill in the content.

Content from CMS

Content for legal pages are stored as MDX files in content collection in packages/cms/src/content/collections/legal directory.

Then it's parsed and rendered as a Next.js page under corresponding slug:

apps/web/src/app/(client)/(marketing)/legal/[...slug]/page.tsx
import { generateParams, getPage } from "~/lib/content/legal";
 
export default function Page({ params }: { params: { slug?: string[] } }) {
  const page = getPage(params.slug);
 
  if (!page) {
    notFound();
  }
 
  return <Mdx data={page.data} />;
}
 
export function generateStaticParams() {
  return generateParams();
}

As it's fully typesafe it also allows us to generate metadata for each page based on the frontmatter that you define in the MDX file:

apps/web/src/app/(client)/(marketing)/legal/[...slug]/page.tsx
export function generateMetadata({ params }: { params: { slug?: string[] } }) {
  const page = getPage(params.slug);
 
  if (!page) {
    return notFound();
  }
 
  return getMetadata({
    title: page.data.title,
    description: page.data.description,
  });
}

Read more about it in CMS section.

ChatGPT prompts

Each .mdx file with legal content include a set of useful prompts that you can use to generate the content.

Please, be aware of this!

Please, be aware that ChatGPT is not a lawyer and the content generated by it should be reviewed by one before publishing. Take your time and treat the generated content as a starting point not a final document.

packages/cms/src/content/collections/legal/privacy-policy.mdx
---
title: Privacy Policy
description: Our privacy policy outlines how we collect, use, and protect your personal information.
---
 
{/* 💡 You can use one of the following ChatGPT prompts to generate this 💡 */}
 
...

Feel free to add your own content or even additional pages to the legal collection.

Last updated on

On this page

Ship your startup everywhere. In minutes.Get TurboStarter