Skip to content

Commit 6dc78aa

Browse files
authored
update readme with new docs-structure (#449)
1 parent 185e247 commit 6dc78aa

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,19 @@ yarn dev # run docs locally
1515

1616
### Adding a new document
1717

18-
All content can be located under the [pages](/pages) directory. The directory structure directly informs the website URL structure, so consider that when placing your new document.
18+
All documentation content is defined by the [`docsStructure`](/src/routing/docs-structure.ts) object. This file is the single source of truth for the docs site structure, navigation, and URL mapping. When running `yarn dev` or `yarn build`, the route indexing script will search the paths described, first for an index.md, then for a PATHNAME.md file if an index.md file isn't found (i.e. it will look first for /overview/introduction/index.md, then /overview/introduction.md if index isn't found).
1919

20-
All of our documents are in standard Markdown (.md) file format. If you are including an image, add it to [public/assets] using the same directory structure as pages.
20+
The indexing script will reconcile routes into the generated [`routes.json`](/generated/routes.json), which needs to be committed to git so changes can be confirmed/tracked. A github workflow will confirm that route changes have been committed (though lastmod timestamps are ignored, as these lag behind by one commit)
2121

22-
Finally, make sure to add your new document to the NavData.tsx file located [here](/src/NavData.tsx).
22+
To add a new document:
23+
- Update [`docsStructure`](/src/routing/docs-structure.ts) to include your new pages/sections. The order and nesting in this object will determine the sidebar navigation and the URL path.
2324

24-
### Updating structure
25+
- Add your new Markdown (`.md`) file to the corresponding location in the [`pages`](/pages) directory.
2526

26-
If you are making any changes to the documentation structure or organization, you'll likely need to set up page redirects. These can be added in [next.config.js](next.config.js). Make sure to
27-
look for internal usages throughout all the documents on the site to make sure that there are no broken links.
27+
- If you include images, place them in [`public/assets`](/public/assets) using a directory structure that matches your document's location in `pages`.
28+
29+
### Updating structure and redirects
30+
31+
If you change the documentation structure (e.g., move, rename, or remove pages), you may need to add redirects to prevent broken links. Redirects are managed directly in [`docs-structure.ts`](/src/routing/docs-structure.ts) via the `redirects` array at the bottom of the file. Redirects on a path already defined by `docsStructure` will override where it reconciles to, which can be confirmed in [`routes.json`](/generated/routes.json)
32+
33+
Whenever you update the structure or add redirects, review internal links throughout the documentation to ensure there are no broken references.

0 commit comments

Comments
 (0)