Browse Source

fix: explain how to add routes to navigation

build/deps-updates
Friedger Müffke 4 years ago
committed by Alexander Graebe
parent
commit
76cfe0da20
  1. 63
      src/pages/ecosystem/contributing.md

63
src/pages/ecosystem/contributing.md

@ -126,48 +126,47 @@ parses the markdown to get some information about the page, such as the title an
#### Adding a new route #### Adding a new route
If you are adding a new route, you have to add your route to a section contained within this file: `src/common/routes/all-routes.json` If you are adding a new route, you have to add your route to a section contained within this file: `src/common/navigation.yaml`
```bash showLineNumbers highlight=11 ```bash showLineNumbers highlight=11
docs.blockstack/ sections:
.github/ - pages:
lib/ - path: /
node_modules/ - path: /build-an-app # is an overview page
public/ - path: /smart-contracts
src/ pages:
_data/ - path: /overview
_includes/ - path: /principals
common/ sections:
routes/ - title: Tutorials
all-routes.json pages:
get-routes.js - path: /hello-world-tutorial
index.ts - path: /counter-tutorial
components/ - path: /testing-contracts
pages/ - path: /public-registry-tutorial
types/ - path: /signing-transactions
- path: /mining # is an overview page
- title: Technology
pages:
- path: /authentication
pages:
- path: /overview
sections:
- title: Tutorials
usePageTitles: true
pages:
- path: /building-todo-app
``` ```
Here is an example of adding a new route (see line #8): Adding a new route requires to add a new `path`.
```json highlight=8
{
"title": "Data Storage",
"routes": [
{ "path": "storage/overview" },
{ "path": "develop/storage" },
{ "path": "storage/authentication" },
{ "path": "storage/write-to-read" },
{ "path": "clarity/my-new-page" }
]
},
```
The script will process that file and pull out the title from the frontmatter of the document. The script will process that file and pull out the title from the frontmatter of the document.
### Non-standard pages ### Non-standard pages
There are a few pages within these docs that are non-standard markdown pages. This means they are using some kind of external data as their source, There are a few pages within these docs that are non-standard markdown pages. This means they are using some kind of external data as their source,
such as the [Clarity Reference page](/references/language-clarity), or the [Blockstack CLI page](/references/blockstack-cli). These pages are using a function of Next.js called such as the [Clarity Reference page](/references/language-overview), or the [Blockstack CLI page](/references/blockstack-cli). These pages are using a function of Next.js called
[`getStaticProps`](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) which allows us to [`getStaticProps`](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) which allows us to
fetch external data at runtime and use it in some way within our pages. fetch external data at runtime and use it in some way within our pages.

Loading…
Cancel
Save