mirror of
https://github.com/bmad-code-org/BMAD-METHOD.git
synced 2026-01-30 04:32:02 +00:00
Add link auditor, reorganize documentation, and README update (#1277)
* feat: add link auditor tools and fix broken docs links - Add audit-doc-links.js to scan docs for broken links with auto-resolution - Add fix-doc-links.js to apply suggested fixes (dry-run by default) - Remove stale "Back to Core Concepts" breadcrumb links - Update BMad acronym to "Breakthrough Method of Agile AI Driven Development" - Update README links to docs.bmad-method.org - Simplify upgrade callout in getting-started tutorial Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: reorganize docs structure and archive v4 tutorial - Remove unused section index files (tutorials, how-to, explanation, reference) - Move getting-started-bmadv4.md to _archive - Update quick-start-bmgd.md to remove archived file reference - Update upgrade-to-v6.md - Update astro.config.mjs for new structure Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: ignore underscore directories in link checker Update check-doc-links.js to skip _archive, _planning, and other underscore-prefixed directories when validating links. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: add v4 users section to README Add links to v4 documentation archive and upgrade guide for users migrating from previous versions. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat: convert docs to site-relative links and add validation tools - Convert all relative links (./ ../) to site-relative paths (/path/) - Strip .md extensions and use trailing slashes for Astro/Starlight - Add fix-doc-links.js to convert relative links to site-relative - Add validate-doc-links.js to check links point to existing files - Remove old audit-doc-links.js and check-doc-links.js - Update build-docs.js to use new validation script - Add npm scripts: docs:fix-links, docs:validate-links - Update style guide with validation steps Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: standardize acronym to BMad across documentation Replace incorrect "BMAD" with correct "BMad" in text and frontmatter while preserving "BMAD-METHOD" in GitHub URLs. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: fix BMad acronym and remove draft README - Correct acronym to "Breakthrough Method of Agile AI Driven Development" - Remove unused README-draft.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: standardize BMad acronym in README Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: standardize FAQ format across all FAQ pages - Add TOC with jump links under "## Questions" - Use ### headers for questions (no Q: prefix) - Direct answers without **A:** prefix - Remove horizontal rules and "Related Documentation" sections - End each FAQ with issue/Discord CTA - Update style guide with new FAQ guidelines - Delete redundant faq/index.md (sidebar handles navigation) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: use repo-relative links with .md for GitHub compatibility Convert all documentation links to repo-relative format (/docs/path/file.md) so they work when browsing on GitHub. The rehype plugin strips /docs/ prefix and converts .md to trailing slash at build time for Astro/Starlight. - Update rehype-markdown-links.js to strip /docs/ prefix from absolute paths - Update fix-doc-links.js to generate /docs/ prefixed paths with .md extension - Convert 217 links across 64 files to new format Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: handle /docs/ prefix in link validator Update resolveLink to strip /docs/ prefix from repo-relative links before checking if files exist. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: restore FAQ index page Re-add the FAQ index page that was accidentally deleted, with updated repo-relative link format. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Alex Verkhovsky <alexey.verkhovsky@gmail.com>
This commit is contained in:
@@ -87,22 +87,115 @@ export default defineConfig({
|
||||
{
|
||||
label: 'Tutorials',
|
||||
collapsed: false,
|
||||
autogenerate: { directory: 'tutorials' },
|
||||
items: [
|
||||
{
|
||||
label: 'Getting Started',
|
||||
autogenerate: { directory: 'tutorials/getting-started' },
|
||||
},
|
||||
{
|
||||
label: 'Advanced',
|
||||
autogenerate: { directory: 'tutorials/advanced' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'How-To Guides',
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'how-to' },
|
||||
items: [
|
||||
{ slug: 'how-to/get-answers-about-bmad' },
|
||||
{
|
||||
label: 'Installation',
|
||||
autogenerate: { directory: 'how-to/installation' },
|
||||
},
|
||||
{
|
||||
label: 'Workflows',
|
||||
autogenerate: { directory: 'how-to/workflows' },
|
||||
},
|
||||
{
|
||||
label: 'Customization',
|
||||
autogenerate: { directory: 'how-to/customization' },
|
||||
},
|
||||
{
|
||||
label: 'Brownfield Development',
|
||||
autogenerate: { directory: 'how-to/brownfield' },
|
||||
},
|
||||
{
|
||||
label: 'Troubleshooting',
|
||||
autogenerate: { directory: 'how-to/troubleshooting' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Explanation',
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'explanation' },
|
||||
items: [
|
||||
{
|
||||
label: 'Core Concepts',
|
||||
autogenerate: { directory: 'explanation/core-concepts' },
|
||||
},
|
||||
{
|
||||
label: 'Architecture',
|
||||
autogenerate: { directory: 'explanation/architecture' },
|
||||
},
|
||||
{
|
||||
label: 'Philosophy',
|
||||
autogenerate: { directory: 'explanation/philosophy' },
|
||||
},
|
||||
{
|
||||
label: 'Features',
|
||||
autogenerate: { directory: 'explanation/features' },
|
||||
},
|
||||
{
|
||||
label: 'Agents',
|
||||
autogenerate: { directory: 'explanation/agents' },
|
||||
},
|
||||
{
|
||||
label: 'BMM',
|
||||
autogenerate: { directory: 'explanation/bmm' },
|
||||
},
|
||||
{
|
||||
label: 'BMad Builder',
|
||||
autogenerate: { directory: 'explanation/bmad-builder' },
|
||||
},
|
||||
{
|
||||
label: 'Game Development',
|
||||
autogenerate: { directory: 'explanation/game-dev' },
|
||||
},
|
||||
{
|
||||
label: 'Creative Intelligence',
|
||||
autogenerate: { directory: 'explanation/creative-intelligence' },
|
||||
},
|
||||
{
|
||||
label: 'Core Module',
|
||||
autogenerate: { directory: 'explanation/core' },
|
||||
},
|
||||
{
|
||||
label: 'FAQ',
|
||||
autogenerate: { directory: 'explanation/faq' },
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Reference',
|
||||
collapsed: true,
|
||||
autogenerate: { directory: 'reference' },
|
||||
items: [
|
||||
{
|
||||
label: 'Agents',
|
||||
autogenerate: { directory: 'reference/agents' },
|
||||
},
|
||||
{
|
||||
label: 'Workflows',
|
||||
autogenerate: { directory: 'reference/workflows' },
|
||||
},
|
||||
{
|
||||
label: 'Configuration',
|
||||
autogenerate: { directory: 'reference/configuration' },
|
||||
},
|
||||
{
|
||||
label: 'Glossary',
|
||||
autogenerate: { directory: 'reference/glossary' },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
/**
|
||||
* Rehype plugin to transform relative markdown file links (.md) to page routes
|
||||
* Rehype plugin to transform markdown file links (.md) to page routes
|
||||
*
|
||||
* Transforms:
|
||||
* ./path/to/file.md → ./path/to/file/
|
||||
* ./path/index.md → ./path/ (index.md becomes directory root)
|
||||
* ../path/file.md#anchor → ../path/file/#anchor
|
||||
* ./file.md?query=param → ./file/?query=param
|
||||
* /docs/absolute/path/file.md → /absolute/path/file/
|
||||
*
|
||||
* Only affects relative links (./, ../) - absolute and external links are unchanged
|
||||
* For absolute paths starting with /docs/, the /docs prefix is stripped
|
||||
* since the Astro site serves content from the docs directory as the root.
|
||||
*
|
||||
* Affects relative links (./, ../) and absolute paths (/) - external links are unchanged
|
||||
*/
|
||||
|
||||
import { visit } from 'unist-util-visit';
|
||||
|
||||
/**
|
||||
* Convert relative Markdown file links (./ or ../) into equivalent page route-style links.
|
||||
* Convert Markdown file links (.md) into equivalent page route-style links.
|
||||
*
|
||||
* The returned transformer walks the HTML tree and rewrites anchor `href` values that are relative paths pointing to `.md` files. It preserves query strings and hash anchors, rewrites `.../index.md` to the directory root path (`.../`), and rewrites other `.md` file paths by removing the `.md` extension and ensuring a trailing slash. Absolute, external, non-relative, non-string, or links without `.md` are left unchanged.
|
||||
* The returned transformer walks the HTML tree and rewrites anchor `href` values that are relative paths (./, ../) or absolute paths (/) pointing to `.md` files. It preserves query strings and hash anchors, rewrites `.../index.md` to the directory root path (`.../`), and rewrites other `.md` file paths by removing the `.md` extension and ensuring a trailing slash. External links (http://, https://) and non-.md links are left unchanged.
|
||||
*
|
||||
* @returns {function} A HAST tree transformer that mutates `a` element `href` properties as described.
|
||||
*/
|
||||
@@ -34,8 +38,13 @@ export default function rehypeMarkdownLinks() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only transform relative paths starting with ./ or ../
|
||||
if (!href.startsWith('./') && !href.startsWith('../')) {
|
||||
// Skip external links (http://, https://, mailto:, etc.)
|
||||
if (href.includes('://') || href.startsWith('mailto:') || href.startsWith('tel:')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Only transform paths starting with ./, ../, or / (absolute)
|
||||
if (!href.startsWith('./') && !href.startsWith('../') && !href.startsWith('/')) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -73,6 +82,11 @@ export default function rehypeMarkdownLinks() {
|
||||
}
|
||||
}
|
||||
|
||||
// Strip /docs/ prefix from absolute paths (repo-relative → site-relative)
|
||||
if (urlPath.startsWith('/docs/')) {
|
||||
urlPath = urlPath.slice(5); // Remove '/docs' prefix, keeping the leading /
|
||||
}
|
||||
|
||||
// Transform .md to /
|
||||
// Special case: index.md → directory root (e.g., ./tutorials/index.md → ./tutorials/)
|
||||
if (urlPath.endsWith('/index.md')) {
|
||||
|
||||
Reference in New Issue
Block a user