Skip to content

Refactor docs site: migrate to content-driven architecture#29

Open
juthing wants to merge 18 commits into
mainfrom
claude/clever-edison-rG42Y
Open

Refactor docs site: migrate to content-driven architecture#29
juthing wants to merge 18 commits into
mainfrom
claude/clever-edison-rG42Y

Conversation

@juthing

@juthing juthing commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

This PR completely restructures the Moddy documentation site from a catalog-based template system to a content-driven architecture. Content is now managed in a /content/ directory with JSON metadata and bilingual Markdown files, processed by Eleventy data scripts rather than copied into the site directory.

Key Changes

Content Architecture

  • New /content/ directory structure: Articles, authors, labels, and legal pages now live in /content/ with standardized JSON metadata + bilingual Markdown
  • Removed old site content: Deleted /site/site/about/ and /site/site/legal/privacy.md (now in /content/legal/)
  • Eleventy data scripts: Added _data/articles.js, _data/authors.js, _data/labels.js, _data/legalPages.js to read and expose content to templates

Layout & Styling

  • New page layouts: Added layouts/article.html, layouts/author.html, layouts/label.html, layouts/legal.html for pagination-based page generation
  • New CSS modules: article.css, author.css, label.css for article, author profile, and collection pages
  • Global CSS refactor: Reorganized global.css with new frame layout system, i18n visibility rules, and Material Design 3 theming
  • Home page redesign: Updated index.html with new hero section and language-aware content blocks

Bilingual Support

  • Language switcher component: New language-switcher.ts web component for fr/en switching with localStorage persistence
  • i18n CSS rules: Added [data-lang] attribute selectors to show/hide language-specific content
  • Inline language detection: New apply-saved-lang.ts script runs in <head> to prevent language flash
  • Translations data: Added _data/translations.js with French/English UI strings

Search & Discovery

  • Full-text search component: New docs-search.ts web component with client-side search over /search-index.json
  • Search index generation: Added search-index.njk template to generate JSON index from articles
  • Search hydration: New hydration-entrypoints/search.ts for lazy-loading search component

Pagination Templates

  • Article pagination: articles/article.njk generates /articles/{id}/ pages from articles data
  • Author pagination: authors/author.njk generates /authors/{discord_id}/ pages
  • Label/collection pagination: collections/label.njk generates /collections/{id}/ pages
  • Legal pagination: legal/legalPage.njk generates /legal/{id}/ pages

Sample Content

  • Added 6 example articles (quick-start, moderation-setup, ticket-system, reminders, premium-features, v1-changelog) with French/English versions
  • Added 6 labels (documentation, moderation, tickets, premium, changelog, legal)
  • Added 3 legal pages (privacy, tos, license) with bilingual content

Build & Config

  • Eleventy config: Updated eleventy.config.cjs with new data directory and pagination setup
  • Vercel config: Enhanced vercel.json with redirects for old URLs and search index route
  • Build script: Converted copy-docs.mjs to a no-op for backwards compatibility
  • Package version: Bumped to 0.1.0

Documentation

  • CLAUDE.md: Added comprehensive reference guide for Claude Code sessions
  • ARCHITECTURE.md: New architecture overview document
  • CONTENT-GUIDE.md: Instructions for adding articles, authors, and legal pages
  • TODO.md: Task list for remaining work

Implementation Details

  • Pagination-based generation: Uses Eleventy's pagination feature to generate individual pages from data arrays, enabling clean URLs and per-page layouts
  • Bilingual content: Articles and legal pages store fr.md and en.md separately; templates render based on data-lang attribute
  • Lazy-loaded components: Search and language switcher use lit-island for hyd

https://claude.ai/code/session_018BHKMZneyDwF5GAR2gxu2Q

@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
moddy_documentation Ready Ready Preview, Comment Jun 2, 2026 5:40pm

…lict with esbuild 0.25)

The plugin was already commented out in esbuild.config.mjs and not imported.
Removing it from devDependencies resolves the npm ERESOLVE error on Vercel.

Also update docs/TODO.md to reflect current state.
…, disable compress plugin

- docs-search.ts + language-switcher.ts: 'lang' conflicts with HTMLElement.lang (public)
- global.ts: ChangeColorEvent/ChangeDarkModeEvent don't overlap with CustomEvent, cast via unknown
- eleventy.config.cjs: disable eleventy-plugin-compress (race condition with passthrough copy;
  Vercel handles CDN-level gzip/brotli anyway)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant