Skip to content

Latest commit

 

History

History
83 lines (56 loc) · 3.09 KB

File metadata and controls

83 lines (56 loc) · 3.09 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Docusaurus 3.9.2 documentation site for the Ultimate Multisite WordPress plugin ecosystem. Deployed to ultimatemultisite.com/docs/ via GitHub Actions on push to main.

Three documentation sections with independent sidebars defined in sidebars.js:

  • User Guide (docs/user-guide/) — end-user documentation
  • Developer (docs/developer/) — hooks reference, REST API, integration guides
  • Addons (docs/addons/) — documentation for 26+ addon plugins

Commands

npm start          # Dev server at localhost:3000 with hot reload
npm run build      # Production build to /build/
npm run serve      # Serve production build locally
npm run clear      # Clear Docusaurus cache (.docusaurus/)

Translation

node scripts/translate.js --locales es,fr      # Translate specific locales
node scripts/translate.js --locales all         # Translate all locales
node scripts/translate.js --locales fr --dry-run  # Preview without writing
node scripts/translate.js --commit              # Auto-commit each translated file

Requires env vars: OPENAI_API_KEY, OPENAI_API_BASE, OPENAI_MODEL (see scripts/translate.env.example).

Hooks Generation

bash scripts/generate-hooks.sh    # Requires PHP 8.3+ and plugin source checkouts

Generates WordPress hooks docs from PHP source into docs/developer/hooks/ and docs/addons/*/hooks/. Requires ultimate-multisite/ and addons/ directories (cloned by CI, gitignored locally).

Architecture

Content

All documentation is Markdown/MDX in docs/. Pages use frontmatter for metadata:

---
title: Page Title
sidebar_position: 1
---

Docs route base path is / (not /docs/), configured in docusaurus.config.js.

i18n

  • English source in docs/, translations in i18n/{locale}/
  • Currently active locales: en, es (100+ more available in config, commented out)
  • RTL languages configured in docusaurus.config.js localeConfigs
  • scripts/translate.js uses OpenAI-compatible API with smart preservation of code blocks, JSX, and links

Auto-Generated Content

  • Hooks docs: Generated by @10up/wp-hooks-documentor from PHP source via scripts/generate-hooks.sh
  • Changelogs: Extracted from addon repos by scripts/update-changelogs.py
  • Both run during CI build before docusaurus build

Custom Components

  • src/components/AddonBanner.js — React component showing purchase/download links for paid addons
  • src/css/custom.css — Green theme (#678233 primary) with dark mode support

CI/CD

Two GitHub Actions workflows:

  • deploy-docs.yml — on push to main: checks out 26+ addon repos, generates hooks/changelogs, builds, deploys via rsync
  • translate.yml — manual trigger: runs AI translation with configurable languages, force, and debug options

Gitignored Build Artifacts

ultimate-multisite/, addons/, wp-hooks-docs/, .hooks-tmp/ are cloned/generated at build time and gitignored. Do not create these directories manually.