Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
bbaea02
feat: système d'articles, auteurs, labels avec i18n
claude Jun 3, 2026
25ecb58
chore: add generated docs files (copy-docs output)
claude Jun 3, 2026
d918c85
feat: migration complète vers le système articles/labels
claude Jun 3, 2026
489b51f
fix: retrait du switcher de langue et du CSS article du layout global
claude Jun 3, 2026
bba712b
content: traduction française de la licence MCL
claude Jun 3, 2026
fb25677
content: traduction française de la politique de confidentialité
claude Jun 3, 2026
239da7c
content: traduction française des conditions générales d'utilisation
claude Jun 3, 2026
0db531c
fix: rendu identique à l'ancien site — migration complète de toutes l…
claude Jun 3, 2026
554a638
Redesign article page layout with banner, structured header, and auth…
claude Jun 3, 2026
89de449
Remove sidebar navigation, add debug article list on homepage
claude Jun 3, 2026
7576041
Restore nav-drawer shell without sidebar navigation content
claude Jun 3, 2026
38df5de
Restore TOC panel and fix missing left margin
claude Jun 3, 2026
dd6cf87
Fix duplicate title, tighten spacing, center banner, update logo & fa…
claude Jun 3, 2026
75f0819
Restore original widths, only reduce vertical spacing, fix logo gap
claude Jun 3, 2026
a112895
Banner border-radius formula, dynamic favicon color from theme
claude Jun 3, 2026
6f849fc
Fix banner radius, logo sizing, and article body layout
claude Jun 3, 2026
395ce2f
Fix horizontal content layout and banner equal margins (verified in b…
claude Jun 3, 2026
2ea4e01
Fix banner rounding, logo size, mobile logo, date script, author sepa…
claude Jun 3, 2026
7c5bd3d
Equalize banner margins, fix mobile crop/bleed, increase header spacing
claude Jun 3, 2026
ebedcfa
Fix mobile left margin: only override pane margin on wide desktop
claude Jun 3, 2026
22b57b0
Equalize page margins on tablet/laptop widths
claude Jun 4, 2026
e3e49eb
Restyle article callouts, enlarge text/title, italic chapeau, hover TOC
claude Jun 4, 2026
825a74b
Match main's callout rules; fix TOC side overflow and hover flicker
claude Jun 4, 2026
345583a
Match main callout width, slide-in TOC with load peek, themed selection
claude Jun 4, 2026
fe40758
Per-article theme color with fade; rework TOC; left-align callouts
claude Jun 4, 2026
cc206ab
TOC: gap from edge when revealed, smoother animation, header shadow
claude Jun 4, 2026
3807703
Fix TOC overlay: remove header shadow, raise z-index above header, cl…
claude Jun 4, 2026
985b2a4
Let TOC shadow extend over header and footer
claude Jun 4, 2026
64b9f08
Add margin and very rounded corners to article banner
claude Jun 4, 2026
2f7ba1b
Increase banner margin and corner radius further
claude Jun 4, 2026
7579725
Dynamic content pane top corners: follow banner curvature at scroll top
claude Jun 4, 2026
daa5e02
Adapt banner for mobile: portrait ratio, smaller margin, concentric r…
claude Jun 4, 2026
8e3adf0
Rounder mobile banner corners (36px banner, 52px pane)
claude Jun 4, 2026
132c808
Clip scrollbar to pane border-radius, fix asymmetric mobile banner ma…
claude Jun 4, 2026
4727118
Add Jules as author on all articles, support avatar decoration in art…
claude Jun 4, 2026
a6d7eaa
Fix oval avatar: add box-sizing border-box so border doesn't stretch …
claude Jun 4, 2026
70118e7
Fix avatar decoration cropping, make scrollbar subtle
claude Jun 5, 2026
3df9167
Revert scrollbar color to primary, clip scrollbar at pane rounded cor…
claude Jun 5, 2026
231c88d
Fix oval avatar and cropped decoration
claude Jun 5, 2026
22134b7
Increase author page avatar size to 90px
claude Jun 5, 2026
fc72baf
Bump author avatar to 96px
claude Jun 5, 2026
b225ef6
Increase decoration container to 140% so it has more room
claude Jun 5, 2026
1e48c9f
Reduce gap between avatar and author name/role
claude Jun 5, 2026
3128298
Move scroll from scroll-wrapper to pane so scrollbar respects border-…
claude Jun 5, 2026
0bb7580
Equal padding on all sides of blockquotes
claude Jun 5, 2026
6b12906
Style hr separators: thin 1px line matching theme outline-variant color
claude Jun 5, 2026
65c7a48
Fix author link hover, enlarge avatar, more deco space, fix scrollbar…
claude Jun 5, 2026
c729b43
Revert decoration size to 120%, fix scrollbar overflow at expanded to…
claude Jun 5, 2026
7b64363
Fix scrollbar clipping (real cause), avatar size decoupled from deco,…
claude Jun 5, 2026
fc76169
Slightly smaller avatar, keep decoration absolute size
claude Jun 5, 2026
4b4cb79
Fix straw clipping on article page: reset border-radius on decoration…
claude Jun 5, 2026
60774d3
Merge pull request #35 from moddy-app/claude/confident-babbage-juJEE
juthing Jun 5, 2026
d84db73
Move nav-drawer styling from global CSS to article template (#36)
juthing Jun 5, 2026
00a4fa5
Update wordmark SVG to 1422px version and add homepage article grid (…
juthing Jun 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# Moddy Docs — CLAUDE.md

## Vue d'ensemble

Site de documentation pour le bot Discord **Moddy**, construit avec **Eleventy (11ty)** + **Lit.js** + **Material Web Components**.

Repo racine : `/home/user/docs/`
Projet Eleventy : `/home/user/docs/site/`

---

## Structure du projet

```
/
├── content/ # Contenu éditorial (articles, auteurs, labels)
│ ├── articles/
│ │ └── {article-id}/
│ │ ├── meta.json # Métadonnées de l'article
│ │ ├── fr.md # Contenu français
│ │ ├── en.md # Contenu anglais
│ │ └── assets/ # Images et ressources
│ ├── authors/
│ │ └── {discord-id}.json # Profil auteur
│ └── labels/
│ └── {label-id}.json # Label/catégorie
├── docs/ # Documentation legacy (pages /about/)
│ ├── quick-start.md
│ ├── intro.md
│ └── Legal/
├── site/ # Projet Eleventy
│ ├── src/ # TypeScript source (composants Lit)
│ ├── site/ # Input Eleventy (templates Nunjucks)
│ │ ├── _includes/ # Layouts HTML
│ │ ├── _data/ # Data files (articles.js, authors.js, labels.js, i18n.js)
│ │ ├── articles/ # Template pagination articles → /articles/{id}/
│ │ ├── collections/ # Template pagination labels → /collections/{id}/
│ │ ├── authors/ # Template pagination auteurs → /authors/{id}/
│ │ ├── about/ # Pages docs legacy
│ │ └── css/ # Feuilles de style
│ ├── eleventy-helpers/ # Plugins/filtres Eleventy custom
│ ├── scripts/ # Scripts de build
│ └── eleventy.config.cjs # Config Eleventy
└── vercel.json # Config déploiement Vercel
```

---

## Architecture du contenu

### Articles (`/content/articles/{id}/`)

**`meta.json`** — Métadonnées :
```json
{
"title": "Titre de l'article",
"id": "slug-article",
"authors": ["discord-id-1"],
"date": "2024-01-15",
"chapeau": { "fr": "Résumé FR", "en": "Summary EN" },
"banner": null,
"seo_level": 1,
"labels": ["label-id"]
}
```

**Niveaux SEO :**
- `1` = Référencement normal
- `2` = Accessible via recherche ou lien label/auteur uniquement (`noindex`)
- `3` = Accessible uniquement via lien direct (`noindex, nofollow`)

**`fr.md` / `en.md`** — Contenu Markdown par langue.

**`assets/`** — Ressources (images, SVG…). Accessibles à `/articles/{id}/assets/`.

---

### Auteurs (`/content/authors/{discord-id}.json`)

```json
{
"id": "123456789012345678",
"username": "DISCORD",
"avatar": "DISCORD",
"avatar_decoration": "DISCORD",
"post": "Product Manager",
"bio": "…",
"banner_color": "#5793f2",
"links": [
{ "name": "Twitter", "icon": "<svg>…</svg>", "url": "https://…" }
]
}
```

La valeur `"DISCORD"` dans `username`, `avatar`, ou `avatar_decoration` déclenche un fetch automatique vers `https://api.moddy.app/users/{id}` au **build time**.

**API Moddy** : `GET https://api.moddy.app/users/{user_id}`
- Retourne `avatar_url`, `global_name`, `avatar_decoration_data.asset_url`, etc.
- Cache 5 minutes côté API.

---

### Labels (`/content/labels/{id}.json`)

```json
{
"id": "change-logs",
"name": { "fr": "Changelogs", "en": "Changelogs" },
"color": "#4caf50"
}
```

---

## URLs

| Type | URL | Redirect depuis |
|------|-----|-----------------|
| Article | `/articles/{article-id}/` | `/{article-id}/` |
| Collection | `/collections/{label-id}/` | `/{label-id}/` |
| Auteur | `/authors/{discord-id}/` | `/{discord-id}/` |

Les redirects courts sont générés statiquement via des templates Eleventy pagination (`redirect-articles.njk`, `redirect-labels.njk`, `redirect-authors.njk`).

---

## Internationalisation (i18n)

- Langues supportées : **fr** (défaut), **en**
- Détection automatique via `navigator.language` + `localStorage` (`moddy-lang`)
- Appliqué immédiatement au `<html data-lang="fr|en">` via `src/inline/apply-lang.ts` (inliné dans le HTML)
- Switcher dans la top app bar (boutons FR / EN)

### Affichage du contenu multilingue

Tout contenu conditionnel utilise l'attribut `data-lang-content` :
```html
<span data-lang-content="fr">Bonjour</span>
<span data-lang-content="en">Hello</span>
```

CSS dans `/css/article.css` :
```css
[data-lang-content] { display: none; }
:root[data-lang="fr"] [data-lang-content="fr"] { display: revert; }
:root[data-lang="en"] [data-lang-content="en"] { display: revert; }
```

---

## Build

```bash
cd site
npm install --legacy-peer-deps

# Développement (watch)
npm run serve:dev

# Production
npm run build:prod
```

**Pipeline Wireit :**
1. `build:copy-docs` — Copie `/docs/*.md` → `site/about/`
2. `build:dev:ts` — TypeScript → `/lib` (ou `/build` en prod)
3. `build:dev:eleventy` — Eleventy lit `site/site/` + `../content/` → `/_dev`

---

## Data files Eleventy

Situés dans `site/site/_data/` :
- `articles.js` — Lit `/content/articles/`, parse les markdown, retourne le tableau trié par date
- `authors.js` — Lit `/content/authors/`, fetch Discord API si `"DISCORD"` présent
- `labels.js` — Lit `/content/labels/`
- `i18n.js` — Traductions UI (fr/en)

---

## Conventions

- Les IDs d'articles et labels sont des slugs kebab-case (ex: `v1-changelog`, `change-logs`)
- Les IDs d'auteurs sont les IDs Discord (entiers 64-bit en string)
- Les bannières peuvent être `null`, une URL, ou un chemin relatif aux assets
- Ne jamais modifier les fichiers dans `_dev/` ou `_prod/` (générés au build)
- Ne pas modifier les fichiers copiés dans `site/site/about/` (générés depuis `/docs/`)
16 changes: 0 additions & 16 deletions site/site/about/size.md → content/articles/bundle-sizes/en.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
<!-- catalog-only-start --><!-- ---
name: Bundle Sizes
title: Bundle Sizes
order: 5
hasToc: false
-----><!-- catalog-only-end -->

# Sizes

<!-- go/mwc-size -->

<!--*
# Document freshness: For more information, see go/fresh-source.
freshness: { owner: 'lizmitchell' reviewed: '2025-11-23' }
*-->

<!-- [TOC] -->

This doc tracks important size metrics for Material Web Components.

Sizes are tracked in bundles. A bundle is a single `.js` file for one or more
Expand Down
13 changes: 13 additions & 0 deletions content/articles/bundle-sizes/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"title": "Bundle Sizes",
"id": "bundle-sizes",
"authors": ["1164597199594852395"],
"date": "2024-01-01",
"chapeau": { "fr": "Analyse des tailles de bundle du projet.", "en": "Project bundle size analysis." },
"banner": null,
"banner_gradient": "linear-gradient(135deg, #4a148c 0%, #ab47bc 50%, #e1bee7 100%)",
"banner_focus": { "x": 50, "y": 50 },
"seo_level": 1,
"labels": ["about"],
"nav_order": 5
}
59 changes: 5 additions & 54 deletions site/site/about/intro.md → content/articles/introduction/en.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,33 @@
<!-- catalog-only-start --><!-- ---
name: Introduction
title: Introduction
order: 1
-----><!-- catalog-only-end -->

# Intro to Material Web Components

<!-- go/mwc-intro -->

<!--*
# Document freshness: For more information, see go/fresh-source.
freshness: { owner: 'lizmitchell' reviewed: '2025-11-23' }
*-->

Material web, also known as Material Web Components or MWC, is a library of
[web components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)<!-- {.external} -->
that follows Google's [Material Design](https://material.io/)<!-- {.external} -->
[web components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)
that follows Google's [Material Design](https://material.io/)
guidelines.

<!-- [TOC] -->

## What is Material?

Material Design is a design system built and supported by Google designers and
developers. Guidelines for building Material apps and components are published
on [material.io](https://material.io)<!-- {.external} -->.
on [material.io](https://material.io).

The latest version, Material 3, enables personal, adaptive, and expressive
experiences – from dynamic color and enhanced accessibility, to foundations for
large screen layouts and design tokens.

![An example of a Material Design application.](images/what-is-material.webp "What is Material?")

## What are web components?

[Web components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)<!-- {.external} -->
[Web components](https://developer.mozilla.org/en-US/docs/Web/API/Web_components)
are custom HTML elements with encapsulated styles and behavior. They work across
many different frameworks (such as Lit, React, Vue, and Svelte) as well as web
environments (such as Eleventy, Wordpress, and Ruby on Rails).

Many components in
this library are drop-in replacements for browser elements like `<button>` and `<input>`.

```html
<!-- Browser elements -->
<form>
<label>
Email
<input type="email" name="email" required>
</label>
<label>
Subscribe
<input type="checkbox" name="subscribe">
</label>

<button type="reset">Reset</button>
<button>Submit</button>
</form>

<!-- Material elements -->
<form>
<md-outlined-text-field label="Email" type="email"
name="email" required></md-outlined-text-field>
<label>
Subscribe
<md-checkbox name="subscribe"></md-checkbox>
</label>

<md-text-button type="reset">Reset</md-text-button>
<md-outlined-button>Submit</md-outlined-button>
</form>
```

## What are tokens?

[Design tokens](https://m3.material.io/foundations/design-tokens/overview)<!-- {.external} -->
[Design tokens](https://m3.material.io/foundations/design-tokens/overview)
are the building blocks of all UI elements. In MWC, tokens are
[CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*)
that can be used to style components.
Expand All @@ -87,5 +40,3 @@ that can be used to style components.
--md-ref-typeface-plain: system-ui;
}
```

<!--#include file="../googlers/intro-who-should-use-mwc.md" -->
13 changes: 13 additions & 0 deletions content/articles/introduction/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"title": "Introduction",
"id": "introduction",
"authors": ["1164597199594852395"],
"date": "2024-01-01",
"chapeau": { "fr": "Découvrez Moddy, le bot Discord tout-en-un.", "en": "Discover Moddy, the all-in-one Discord bot." },
"banner": null,
"banner_gradient": "linear-gradient(135deg, #6750a4 0%, #9c8cd4 50%, #d4c8f0 100%)",
"banner_focus": { "x": 50, "y": 50 },
"seo_level": 1,
"labels": ["about"],
"nav_order": 1
}
Loading