Restructure public/docs/ into per-language directory hierarchy with app route migration#166
Conversation
…x.yml Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
my-code | 9fa2c0a | Commit Preview URL Branch Preview URL |
Feb 24 2026, 11:17 AM |
c987147 to
c6713d7
Compare
|
@copilot ./public/docs/typescript/ 以下のドキュメントと ./public/docs/rust/ 以下のドキュメントのファイル名とidを意味のある名前につけ直してください。 |
Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
対応しました (93de093)。 すべての
cpp/javascript などの既存の命名規則に揃えています。 |
|
Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
対応しました (0d7ee22)。 1.
2.
|
|
@copilot
の部分と、app/sidebar.tsxのLinkタグのhrefで、配列のindexではなくセクションのidを使用するようにして。
|
Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
…ontent Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
対応しました。4項目それぞれ別コミットにしています。
|
|
@copilot
の部分と、app/sidebar.tsxのLinkタグのhrefで、配列のindexではなくセクションのidを使用するようにして。
|
…rom getPagesList Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
… href Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
Co-authored-by: na-trium-144 <100704180+na-trium-144@users.noreply.github.com>
4項目それぞれ別コミットで対応しました。
Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Flat
public/docs/{lang}-{n}.mdfiles are reorganized into a structured directory tree with per-languageindex.ymlmetadata and per-page section splits. The app routing is updated to use the new directory structure.New
public/docs/structureBoth
sections.yml(ordered file list per page directory) andlanguages.yml(list of language directories) are generated at build time and excluded from version control.index.ymlper languageSection files
Each h2/h3 heading becomes its own
.mdfile with YAML frontmatter. The-intro.mdfile holds the text before the first section heading and has no frontmatter.Section files use the naming convention
N1-N2-slug.md:##) heading0for the h2 itself,1,2,3… for subsequent h3/h4 headings under itBuild-time generation scripts
scripts/generateSectionsList.ts: Generates asections.ymlfile in each page directory, listing all.mdfiles in display order (-intro.mdfirst, then section files sorted byN1-N2prefix). Usesjs-yamlfor YAML serialization.scripts/generateLanguagesList.ts: Scanspublic/docs/for language directories and generatespublic/docs/languages.yml. Used by Cloudflare deployments to discover available languages without filesystem access.Both run automatically via
npm run buildandnpm run dev. Generated files are gitignored.New app route:
app/[lang]/[pageId]/The route
app/[docs_id]/is supplemented byapp/[lang]/[pageId]/(e.g./cpp/0-intro). The newpage.tsx:sections.yml(parsed withjs-yaml) to get the ordered file list.mdfile and parses YAML frontmatter usingjs-yamlMarkdownSection[]:-intro.mdintro section getslevel: 1and its title from the page'snamefieldUpdated app navigation
app/pagesList.tsdeleted; replaced byapp/lib/getPagesList.tswhich readspublic/docs/{lang}/index.ymlat runtime. On Cloudflare, language discovery useslanguages.yml; on Node.js, it usesreaddirdirectly.app/layout.tsx: converted to async server component; callsgetPagesList()and passes data as props to<Sidebar>and<Navbar>app/sidebar.tsx: acceptspagesList: LanguageEntry[]prop; displayspage.namefromindex.yml; sidebar section links usesection.idas anchor hrefapp/navbar.tsx: acceptspagesList: LanguageEntry[]propapp/page.tsx: converted to async server component usinggetPagesList()app/[docs_id]/splitMarkdown.ts:MarkdownSectioninterface hasid: string; usesrawContentonly (no separatecontentfield)app/[docs_id]/pageContent.tsx: renderssection.rawContentviaStyledMarkdowndirectly;DynamicMarkdownSectionusessection.iddirectly (no redundantsectionIdfield); section DOM elements usesection.idas theiridattribute for anchor navigationapp/actions/chatActions.ts: usessection.iddirectly instead ofsection.sectionIdScope
-intro.mdfiles, 734 section files{lang}-{dir-slug}-{section-slug}format); all YAML frontmatter validsections.ymlandlanguages.ymlgitignored (generated at build time)✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.