feat(wiki): serve the legal pages at /terms-of-service and /privacy-policy

Discord, and most platforms, ask for a terms URL and a privacy URL in a
form field; pasting a `/wiki/...` address there reads like an afterthought.
Both pages now answer at the root, while everything else stays under
`/wiki/`.

The API states each page's address instead of leaving the front to rebuild
it, so there is one place that decides. Existing pages are renamed rather
than recreated, keeping whatever has already been written in them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
nocodeandClaude Opus 5 committed 2026-09-23 23:25:59 +02:00
1 parent e1b9a5cc77
commit 3d0e21d7cb
7 files changed
+83 -26

No files matched your search

+15 -4
View File
@@ -15,6 +15,17 @@ import { countPages, createPage, getPageBySlug } from '../../database/repositori
const log = createLogger('wiki');
/**
* Pages served at the root rather than under `/wiki/`.
*
* Discord, and most platforms, ask for a terms URL and a privacy URL; pasting
* `/wiki/...` in those fields reads like an afterthought.
*/
export const ROOT_PAGES = Object.freeze(['terms-of-service', 'privacy-policy']);
/** Public address of a page, root pages included. */
export const pagePath = (slug) => (ROOT_PAGES.includes(slug) ? `/${slug}` : `/wiki/${slug}`);
const TERMS = `## 1. Objet
Ces conditions régissent l'utilisation du bot Discord **FWS-Bot** et de son tableau de bord, exploités par **[NOM DE L'ENTITÉ RESPONSABLE]** (ci-après « nous »).
@@ -185,8 +196,8 @@ Ces pages sont rédigées et publiées depuis le tableau de bord du bot : elles
## Pour commencer
- **Conditions d'utilisation** — ce à quoi tu t'engages en utilisant le bot.
- **Politique de confidentialité** — quelles données sont traitées, pourquoi, et tes droits.
- [**Conditions d'utilisation**](/terms-of-service) — ce à quoi tu t'engages en utilisant le bot.
- [**Politique de confidentialité**](/privacy-policy) — quelles données sont traitées, pourquoi, et tes droits.
## Contribuer
@@ -206,7 +217,7 @@ const DEFAULT_PAGES = [
isProtected: false,
},
{
slug: 'conditions-utilisation',
slug: 'terms-of-service',
title: 'Conditions d’utilisation',
summary: 'Ce à quoi tu t’engages en utilisant le bot FWS.',
category: 'Légal',
@@ -216,7 +227,7 @@ const DEFAULT_PAGES = [
isProtected: true,
},
{
slug: 'politique-confidentialite',
slug: 'privacy-policy',
title: 'Politique de confidentialité',
summary: 'Données traitées, durées de conservation et droits, selon la LPD suisse.',
category: 'Légal',