Skip to content

refactor/flat-content-structure - #666

Open
serafim-san wants to merge 3 commits into
mainfrom
refactor/flat-content-structure
Open

refactor/flat-content-structure#666
serafim-san wants to merge 3 commits into
mainfrom
refactor/flat-content-structure

Conversation

@serafim-san

@serafim-san serafim-san commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

This refactoring has been hanging over me as tech debt since the academy migration. During the move I changed the content file structure (section folders + mapping to flat URLs), thinking it would make working with folders easier. Dima rightly pointed out back then that there's little to gain from it: academy URLs are flat and SEO-frozen, and a folder hierarchy is only justified when it's isomorphic to the URL space. Any "tree → URL" transformation is a permanent tax: the getPublicSlug bottleneck that every path went through.

What's done:

  • src/content/docs/ is now flat: folders mirror public URLs 1:1, doc.id = public slug, getPublicSlug/paths.ts and the collision guard are removed, collisions are impossible by construction.
  • Sidebar sections and top-level ordering moved to ROOT_SECTIONS (src/config/navigation.ts)
  • Removed sidebar.order from product root index docs.

Checks: sitemap.xml is set-identical before/after, sidebar link sequence is unchanged

@serafim-san
serafim-san force-pushed the refactor/flat-content-structure branch from e63f707 to 5048c48 Compare August 18, 2026 13:07
Remove the getting-started/guides/resources/ai-toolkit section level
so content paths mirror public URLs 1:1. Pure file moves.
Drop getPublicSlug/paths.ts: with flat content folders doc.id is the
public URL, so slug stripping and the collision guard are unnecessary
by construction. Sidebar section membership and top-level order now
come from ROOT_SECTIONS items arrays in src/config/navigation.ts.
Top-level sidebar order now comes from ROOT_SECTIONS items arrays;
frontmatter order is only read for nested articles.
@serafim-san
serafim-san force-pushed the refactor/flat-content-structure branch from 5048c48 to c32094c Compare August 26, 2026 00:01
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