Skip to content

fix(import): RM-17139 Ensure no /docs/docs slugs#23

Open
xavierandueza wants to merge 6 commits into
fix/rm-17180-importer-imported-page-shows-redirect-textfrom
fix/rm-17139-importer-docs-as-slug-for-docs-pages
Open

fix(import): RM-17139 Ensure no /docs/docs slugs#23
xavierandueza wants to merge 6 commits into
fix/rm-17180-importer-imported-page-shows-redirect-textfrom
fix/rm-17139-importer-docs-as-slug-for-docs-pages

Conversation

@xavierandueza

@xavierandueza xavierandueza commented Jun 29, 2026

Copy link
Copy Markdown
Contributor
🚥 Resolves RM-17139

🧰 Changes

  • BEFORE: docs-site entry pages at generic routes could publish with generic guide slugs like docs.
  • AFTER: generic docs route pages use a meaningful introduction slug.
  • Generic docs categories no longer force docs-prefixed page slugs when cleaner slugs are available.

🧬 QA & Testing

  • node --test src/commands/import.slug-planner.test.js
  • npm test
  • Runner smoke: npm run step:skeleton https://www.mintlify.com/docs
    • This was the original root issue
    • Now the /docs/docs -> /docs/getting-started-introduction
      • This isn't just "introduction" because there are 2x introduction now, one in we made from docs/index.md and one from docs/api/index.md
        • When 2x categories share the same final slug, we make them both keep rolling back until we have unique slugs.
      • Although this may seem a bit messy, its the best way to handle this in a consistent IMO

@xavierandueza xavierandueza self-assigned this Jun 29, 2026
@xavierandueza xavierandueza changed the base branch from main to fix/rm-17180-importer-imported-page-shows-redirect-text June 29, 2026 08:38

@xavierandueza xavierandueza left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: the slug normalization is collapsing terminal generic docs pages to the category slug in non-generic categories. That misses the main invariant and needs a small restructuring before merge.

Comment thread src/commands/import.js Outdated
return extractUrlPathSegments(p.url)
}
const normalizedSegmentsFor = (p, categorySeg) => {
const rawSegments = categorySeg ? [categorySeg, ...segmentsFor(p)] : segmentsFor(p)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This combines the category segment with the URL segments before deciding whether a terminal generic docs route should fall back to introduction, which changes the invariant. A page at https://example.com/docs under a non-generic category currently becomes the category slug, not introduction:

const page = { title: 'Docs', url: 'https://example.com/docs' }
ensureUniqueSlugs([{ title: 'Guides', pages: [page] }]).get(page) // guides

That means the fix only works when the organizer happens to put the entry page under a generic category. The cleaner model is to normalize the URL/virtual path first, turn an all-generic path into ['introduction'], and only then add the category as the outermost expansion segment for collision disambiguation. That keeps the base slug behavior deterministic (introduction) while still allowing guides-introduction if it genuinely collides.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(agent response)
Fixed — normalized the page URL/virtual path before adding the category expansion segment, so terminal generic docs pages resolve to introduction under non-generic categories while collisions can still expand to guides-introduction. Added regression coverage. 36108cb

…' into fix/rm-17139-importer-docs-as-slug-for-docs-pages
@xavierandueza xavierandueza marked this pull request as ready for review June 29, 2026 10:06
@xavierandueza xavierandueza changed the title fix(import): RM-17139 Generic docs routes publish as docs pages fix(import): RM-17139 Ensure no /docs/docs slugs Jun 29, 2026
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