Skip to content

fix: de-duplicate sidebar and document site structure - #10

Merged
cner-smith merged 3 commits into
mainfrom
fix/sidebar-duplication
May 24, 2026
Merged

fix: de-duplicate sidebar and document site structure#10
cner-smith merged 3 commits into
mainfrom
fix/sidebar-duplication

Conversation

@cner-smith

@cner-smith cner-smith commented May 24, 2026

Copy link
Copy Markdown
Collaborator

What does this change?

Two related changes to the website:

  1. Fixes duplicated sidebar entries introduced in initial structure upload with placeholders #9, and makes the duplication structurally hard to reintroduce. In site/astro.config.mjs, the Guides / Templates / Tools / Case Studies autogenerate blocks were listed twice, and the Guides autogenerate recursed into the module-0/ and phase-*/ subfolders that were also curated by hand — so every module and phase page was emitted multiple times in the left navigation.

    The fix removes the duplicate block and drives each Module 0 / Phase group from its folder with autogenerate (keeping a custom label) instead of hand-listed slugs. Ordering now comes from each page's existing sidebar.order frontmatter, so the rendered nav is identical (verified: 18 links, no duplicates, original teaching order) — but contributors never edit this config to add, remove, or reorder a page within a section. Guides stays an explicit landing + reference list so it doesn't re-list the module/phase tree.

  2. Adds site/README.md — a structure-and-authoring reference covering the two page types, the nested src/content/docs/docs/ folders, the file→URL mapping, how to add a page, and how the sidebar is configured (autogenerate-driven, plus the overlap that produces duplicates). CONTRIBUTING.md links to it.

Why?

The navigation listed the same module and phase pages several times. The root cause was a structural overlap — curated sidebar groups living inside a directory that was also autogenerated. Beyond fixing the symptom, this moves the curated groups onto autogenerate too, so adding content no longer means editing the sidebar config (the step where the overlap was introduced). The new docs explain the layout and the pitfall.

Type of change

  • New content (case study, implementation guide, policy template, etc.)
  • New code (Terraform, CloudFormation, scripts, etc.)
  • New legal template
  • Correction or update to existing content
  • Documentation or formatting fix
  • Other (describe above)

Checklist

  • All factual claims are sourced and citations are included — n/a (config + internal docs)
  • Content about a specific Tribal Nation is sourced from that nation's own materials or direct consultation — n/a
  • Any pricing or platform-specific details include an "as of [date]" qualifier — n/a
  • No vendor promotional content presented as neutral guidance
  • If adding code: it has been tested and reviewed for security issues — npm run build passes clean (22 pages, no warnings); built sidebar verified to contain 18 links with no duplicates
  • CHANGELOG.md has been updated — handled automatically by release-please from the fix: commit

Notes for reviewers

  • No visible change to the rendered sidebar — the Module 0 / Phase 1–3 layout and ordering are preserved exactly. The change is in how those groups are populated (folder + frontmatter instead of hand-listed slugs).
  • Guides is intentionally the one explicit list (landing + example-guide): autogenerating docs/guides would recurse into the module-0/ and phase-*/ folders and re-list them. The rule is documented in site/README.md: each directory is owned by exactly one sidebar entry.
  • Two commits: the de-duplication fix, then the refactor onto autogenerate.

The sidebar in astro.config.mjs listed Guides/Templates/Tools/Case Studies
twice, and its "Guides" autogenerate recursed into the module-0/ and phase-*/
subfolders that are also curated by hand — so every module and phase page
appeared multiple times in the left nav.

Convert "Guides" to an explicit landing + reference list so it no longer
recurses into the curated Module/Phase sections, and remove the duplicated
resource block. Each section now appears exactly once; the build is clean.

Also add site/README.md documenting how the site is structured — including
the nested src/content/docs/docs/ folders, the file-to-URL mapping, how to add
a page, and how the sidebar is wired (autogenerate vs. explicit, and the
duplication trap to avoid). CONTRIBUTING.md now points to it.
The initial fix removed the duplication but kept the Module 0 and Phase
groups as hand-listed `items: [{ slug }]` arrays, which meant adding a page
still required editing astro.config.mjs -- the same friction that led to the
duplicate entries in the first place.

Switch those groups to `autogenerate` with a custom label, so their pages and
ordering come entirely from the folder and each page's sidebar.order
frontmatter. The page slugs already carried correct order values, so the
rendered sidebar is identical (verified: 18 links, no duplicates, original
teaching order preserved) -- but contributors no longer touch this config to
add, remove, or reorder a page within a section.

Update site/README.md's sidebar section to describe the autogenerate-driven
model and when (rarely) the config needs editing.
@cner-smith
cner-smith merged commit c9b9eb3 into main May 24, 2026
2 checks passed
@cner-smith
cner-smith deleted the fix/sidebar-duplication branch May 24, 2026 03:18
…rview"

Add a "Controlling how a page looks in the sidebar" section to site/README.md
covering title vs sidebar.label, sidebar.order (with gap advice), and badges,
plus the index-vs-group label pattern.

Set sidebar.label: Overview on guides/module-0/index.md so the Module 0
group's first entry reads "Overview" instead of repeating the full module title.
cner-smith added a commit that referenced this pull request May 24, 2026
…12)

After #10 the Module 0 and Phase 1-3 groups sat at the top level of the
sidebar, as siblings of "Guides", even though all of that content lives under
docs/guides/. Move them inside the Guides group's `items` so the navigation
matches the content structure: Guides now expands to the landing page, the
example reference, and the Module 0 / Phase sub-groups.

No change to page content, slugs, or ordering -- still autogenerate-driven and
duplicate-free (verified against the built nav). site/README.md updated to show
the nested structure.
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