Skip to content

Commit 90a5616

Browse files
committed
feat: documentation for navigation closes newrelic#135
1 parent 57746e8 commit 90a5616

File tree

1 file changed

+51
-2
lines changed

1 file changed

+51
-2
lines changed

CONTRIBUTING.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Table of Contents
22

33
- [Guidelines for contributing](#guidelines-for-contributing)
4-
- [Style guide](STYLE_GUIDE.md) **TODO**
4+
- [Style guide](https://github.com/newrelic/developer-website/blob/develop/STYLE_GUIDE.md)
5+
- [Updating the navigation](#updating-the-navigation)
56

67
# Guidelines for contributing
78

@@ -13,5 +14,53 @@ Note that our [code of conduct](./CODE_OF_CONDUCT.md) applies to all platforms a
1314

1415
If you wish to make ducmentation edits, create a guide, or add new documentation, follow our documentation contribution guidelines below. **TODO**
1516

16-
If you'd like to make code contributions, follow the code [style guide](STYLE_GUIDE.md).
17+
If you'd like to make code contributions, follow the code [style guide](https://github.com/newrelic/developer-website/blob/develop/STYLE_GUIDE.md).
1718

19+
# Updating the navigation
20+
21+
Navigation for [docs.newrelic.com](https://docs.newrelic.com) is stored in `YAML` files located in the [`src/nav`](https://github.com/newrelic/docs-website/tree/develop/src/nav) directory. Each top-level navigation should have it's own configuration file. For example, here is a snippet of the [`src/nav/insights.yml`](https://github.com/newrelic/docs-website/blob/develop/src/nav/insights.yml) configuration:
22+
23+
```yml
24+
title: Insights
25+
children:
26+
- title: Use Insights UI
27+
children:
28+
- title: Getting started
29+
children:
30+
- title: Introduction to New Relic Insights
31+
path: /docs/insights/use-insights-ui/getting-started/introduction-new-relic-insights
32+
- title: Manage dashboards
33+
children:
34+
- title: Chart types
35+
path: /docs/insights/use-insights-ui/manage-dashboards/chart-types
36+
- title: Filter Insights dashboards
37+
path: /docs/insights/use-insights-ui/manage-dashboards/filter-insights-dashboards
38+
- title: View, organize, share Insights dashboards
39+
path: /docs/insights/use-insights-ui/manage-dashboards/view-organize-share-insights-dashboards
40+
```
41+
42+
Each "node" in the `.yml` configuration file can have the following properties:
43+
44+
| Key | Required? | Description |
45+
| ---------- | --------- | ----------------------------------------- |
46+
| `title` | yes | The text that is shown in the navigation. |
47+
| `path` | no | The URL path to the page. |
48+
| `children` | no | Any sub-navigation "nodes". |
49+
50+
When the user goes to a page, we determine which section of the site they are on and load the appropriate `.yml` file to populate the sidebar navigation. The navigation for the homepage is an aggregate of all the top-level pages.
51+
52+
## Adding a new page
53+
54+
1. Determine which section of the navigation you would like the page to belong to (i.e. _Full Stack Observability_).
55+
2. Find the configuration file for that section (i.e. [`src/nav/full-stack-observability.yml`](https://github.com/newrelic/docs-website/blob/develop/src/nav/full-stack-observability.yml)).
56+
3. Find the parent page you would like the new page to live under.
57+
4. Add a "node" for the page under the parent page's `children`.
58+
59+
If you intend on adding an entirely new section to the navigation, create a new file in the [`src/nav`](https://github.com/newrelic/docs-website/tree/develop/src/nav) directory using the same format as outlined above.
60+
61+
## Moving a page to a new location
62+
63+
1. Determine which section of the navigation the page.
64+
2. Find the configuration file for that section.
65+
3. Find the page within the configuration file and delete that entry.
66+
4. Follow the steps above to add the page to a new location.

0 commit comments

Comments
 (0)