MuseMVP Docs

Privacy and Terms Configuration

Configure legal page visibility, entry mapping, and custom legal copy.

The legal module renders Privacy, Terms, and Behavior (community guidelines) pages. Visibility is controlled by config; content can come from Content Collections defaults or custom functions.

Scope and Entry Points

src/app/(landing-page)/[locale]/(cms)/legal/[...path]/page.tsx
src/config/custom-common.ts
src/config/custom-legal.ts
content/legal
FilePurpose
legal/[...path]/page.tsxLegal route and config.ui.legal.enabled check
custom-common.tsFooter legal link assembly from allowMap
custom-legal.tsCustom legal copy toggles and content functions
content/legalContent Collections legal MDX source

Fast Edit Path

Use config.ui.legal.enabled and allowMap to control visibility.

Set config.i18n.locales.*.footerConfig.legal for footer labels.

For custom copy, enable useLegalCustom* in custom-legal.ts and provide content functions.

// src/config/index.ts
ui: {
  legal: {
    enabled: true,
    allowMap: [
      { type: "privacy", enabled: true },
      { type: "terms", enabled: true },
      { type: "behavior", enabled: false },
    ],
  },
}
// src/config/index.ts
i18n: {
  locales: {
    zh: {
      footerConfig: {
        legal: {
          privacy: "隐私政策",
          terms: "服务条款",
          behavior: "社区规范",
        },
      },
    },
    en: {
      footerConfig: {
        legal: {
          privacy: "Privacy",
          terms: "Terms",
          behavior: "Community",
        },
      },
    },
  },
}

Default vs Custom Content

By default, legal pages use Content Collections template content. To fully override:

// src/config/custom-legal.ts
export const useLegalCustomPrivacyData = true;
export const useLegalCustomTermsData = false;
export const useLegalCustomBehaviorData = false;

export const legalI18nPrivacyContent: Record<string, (appInfo: AppInfo) => string> = {
  zh: (appInfo) => `# 隐私政策\n\n...your Markdown...`,
  en: (appInfo) => `# Privacy Policy\n\n...`,
};

Content Functions

Content functions receive appInfo and return Markdown strings, useful for inserting app name and other dynamic text.

Config Reference

ConfigLocationDefaultEffect
config.ui.legal.enabledsrc/config/index.tstrueControls /legal/** access
config.ui.legal.allowMapsrc/config/index.tsprivacy/terms on, behavior offFooter links and accessible sub-pages
config.i18n.locales.*.footerConfig.legalsrc/config/index.tsPrivacy/Terms/CommunityFooter legal group labels
useLegalCustom* and legalI18n*Contentsrc/config/custom-legal.tsfalse / emptyWhether to use custom Markdown content