From 12af6b91f333090adb8e8de7c83bc25a64de8eb1 Mon Sep 17 00:00:00 2001 From: Matt Kane Date: Sat, 16 May 2026 12:06:09 +0100 Subject: [PATCH 1/8] docs: add documentation style guide and bring all docs up to standard Adds a Documentation Style Guide (contributing/docs-style-guide) distilling Astro-grade conventions: readability, neutral voice (no we/us/let's), code-sample intros, Expressive Code diffs, the upgrade-guide breaking-changes format, headings, and EmDash specifics (sandboxed vs native, Atmosphere accounts, experimental surfaces, no messages.po in PRs). Audits and updates every other docs page against it. Excludes the pages in PR #1059 (plugin CLI/manifest/authoring docs). Also fixes real defects found during the audit: broken Astro frontmatter in three coming-from/wordpress code samples, two dead internal links (plugin-porting -> porting-plugins), an inconsistent field-type count, and competitor name-drops. --- docs/astro.config.mjs | 4 + .../docs/coming-from/astro-for-wp-devs.mdx | 12 +- docs/src/content/docs/coming-from/astro.mdx | 12 +- .../content/docs/coming-from/wordpress.mdx | 15 +- .../src/content/docs/concepts/admin-panel.mdx | 121 ++++++++------- .../content/docs/concepts/architecture.mdx | 113 +++++++------- .../src/content/docs/concepts/collections.mdx | 54 +++---- .../content/docs/concepts/content-model.mdx | 102 ++++++------- .../docs/contributing/docs-style-guide.mdx | 140 ++++++++++++++++++ docs/src/content/docs/contributing/index.mdx | 2 +- .../content/docs/contributing/translating.mdx | 6 +- .../content/docs/deployment/cloudflare.mdx | 4 +- docs/src/content/docs/deployment/database.mdx | 2 +- docs/src/content/docs/deployment/nodejs.mdx | 8 +- docs/src/content/docs/deployment/storage.mdx | 6 + docs/src/content/docs/docs-mcp.mdx | 28 ++-- docs/src/content/docs/getting-started.mdx | 28 ++-- .../content/docs/guides/atmosphere-auth.mdx | 10 +- .../content/docs/guides/authentication.mdx | 14 +- .../src/content/docs/guides/create-a-blog.mdx | 20 +-- .../docs/guides/internationalization.mdx | 6 +- .../src/content/docs/guides/media-library.mdx | 14 +- docs/src/content/docs/guides/preview.mdx | 10 +- docs/src/content/docs/guides/sections.mdx | 24 ++- .../src/content/docs/guides/site-settings.mdx | 10 +- docs/src/content/docs/guides/taxonomies.mdx | 18 ++- docs/src/content/docs/guides/widgets.mdx | 4 + .../docs/guides/working-with-content.mdx | 8 +- .../src/content/docs/guides/x402-payments.mdx | 4 + docs/src/content/docs/index.mdx | 9 +- docs/src/content/docs/introduction.mdx | 4 +- .../content/docs/migration/content-import.mdx | 32 ++-- .../content/docs/migration/from-wordpress.mdx | 2 +- .../docs/migration/porting-plugins.mdx | 6 +- .../creating-native-plugins/distributing.mdx | 10 +- .../page-fragments.mdx | 10 +- .../portable-text-components.mdx | 2 +- .../creating-native-plugins/react-admin.mdx | 16 +- .../your-first-native-plugin.mdx | 14 +- docs/src/content/docs/plugins/field-kit.mdx | 22 +-- docs/src/content/docs/plugins/installing.mdx | 6 +- docs/src/content/docs/plugins/overview.mdx | 2 +- docs/src/content/docs/reference/api.mdx | 68 ++++++--- docs/src/content/docs/reference/cli.mdx | 24 +-- .../content/docs/reference/configuration.mdx | 93 +++++++----- .../content/docs/reference/field-types.mdx | 22 +-- docs/src/content/docs/reference/hooks.mdx | 4 +- .../src/content/docs/reference/mcp-server.mdx | 8 + docs/src/content/docs/reference/rest-api.mdx | 12 +- .../content/docs/themes/creating-themes.mdx | 22 ++- docs/src/content/docs/themes/overview.mdx | 49 ++---- .../content/docs/themes/porting-wp-themes.mdx | 9 +- docs/src/content/docs/themes/seed-files.mdx | 22 +-- docs/src/content/docs/why-emdash.mdx | 2 +- 54 files changed, 783 insertions(+), 486 deletions(-) create mode 100644 docs/src/content/docs/contributing/docs-style-guide.mdx diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index a7f0157d7..ce2cc21cc 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -147,6 +147,10 @@ export default defineConfig({ collapsed: true, items: [ { label: "Contributor Guide", slug: "contributing" }, + { + label: "Documentation Style Guide", + slug: "contributing/docs-style-guide", + }, { label: "Translating EmDash", slug: "contributing/translating" }, ], }, diff --git a/docs/src/content/docs/coming-from/astro-for-wp-devs.mdx b/docs/src/content/docs/coming-from/astro-for-wp-devs.mdx index a2ff96094..3e611785d 100644 --- a/docs/src/content/docs/coming-from/astro-for-wp-devs.mdx +++ b/docs/src/content/docs/coming-from/astro-for-wp-devs.mdx @@ -41,7 +41,7 @@ WordPress themes have a flat structure with magic filenames. Astro uses explicit | `style.css` | `src/styles/` | Global CSS | | `functions.php` | `astro.config.mjs` | Site configuration | -A typical Astro project: +The following tree shows a typical Astro project layout: ``` src/ @@ -64,6 +64,8 @@ src/ 1. **Frontmatter** (between `---` fences) — Server-side code, like PHP at the top of a template 2. **Template** — HTML with expressions, like the rest of a PHP template +The following component declares typed props in the frontmatter and renders them in the template: + ```astro title="src/components/PostCard.astro" --- // Frontmatter: runs on server, never sent to browser @@ -183,7 +185,7 @@ const { title, featured = false } = Astro.props; ``` -Usage: +The following markup uses that component, passing the default slot and a named `footer` slot: ```astro @@ -249,7 +251,7 @@ The difference: slots receive child elements at the call site, while WordPress h ## Layouts -Layouts wrap pages with common HTML structure—the ``, header, footer, and anything shared across pages. This replaces `header.php` + `footer.php`. +Layouts wrap pages with common HTML structure—the ``, header, footer, and anything shared across pages. This replaces `header.php` + `footer.php`. The following layout defines that shared shell and exposes a slot for page content: ```astro title="src/layouts/Base.astro" --- @@ -402,9 +404,9 @@ For simple interactions, add a `