docs: add frontmatter metadata example

pull/26430/head
Nicolás Quiroz 2 years ago
parent db30491147
commit 5bf99f3c06
  1. 18
      README.md

@ -29,7 +29,7 @@ The website code is organized with a top-level `docs` folder that contains all t
Documentation pages are located in the `/docs` folder in the root directory of the project. The docs pages are all markdown files. When you want to add a new page, add the new file in the appropriate folder in the `/docs` page. `index.md` files will be the default page for a directory, and `{pagename}.md` will define subpages for a directory. Documentation pages are located in the `/docs` folder in the root directory of the project. The docs pages are all markdown files. When you want to add a new page, add the new file in the appropriate folder in the `/docs` page. `index.md` files will be the default page for a directory, and `{pagename}.md` will define subpages for a directory.
After adding a page, you will also need to list it in `/src/data/documentation-links.yaml`. This file defines the documentation structure which you will see on the left sidebar in the documentation pages. After adding a page, you will also need to list it in `/src/data/documentation-links.yaml`. **This file defines the documentation structure which you will see on the left sidebar in the documentation pages**. Take into account that if you update the `/docs` structure or remove a doc, you should also update this file to avoid navigation issues.
#### Adding notes to a doc #### Adding notes to a doc
@ -41,8 +41,7 @@ Notes in documentation pages are highlighted boxes (color depend on the current
<img width="809" alt="Screen Shot 2023-01-04 at 18 22 06" src="https://user-images.githubusercontent.com/948922/210652463-1fc0370e-815c-427d-9eff-64199a300460.png"> <img width="809" alt="Screen Shot 2023-01-04 at 18 22 06" src="https://user-images.githubusercontent.com/948922/210652463-1fc0370e-815c-427d-9eff-64199a300460.png">
> Example Note from [Account Management with Clef > Example Note from [Account Management with Clef](https://geth.ethereum.org/docs/fundamentals/account-management) doc.
](https://geth.ethereum.org/docs/fundamentals/account-management) doc
#### Images #### Images
@ -52,6 +51,19 @@ Images should be saved to `public/images/docs` and included in the markdown as f
![alt-text](/images/docs/image-title.png) ![alt-text](/images/docs/image-title.png)
``` ```
#### Metadata
`title` and `description` are **required** metadata props for a post: `title` will generate the main heading on the doc page and `description` is used for SEO purposes, to serve as a concise and appropiate description of the content.
```
---
title: Go API
description: Introduction to the Go packages that allow Geth to be used in Go native applications.
---
```
> Example of the metadata for a sample post.
### Building locally ### Building locally
To check a new page it is helpful to build the site locally and see how it behaves in the browser. First, run the development server: To check a new page it is helpful to build the site locally and see how it behaves in the browser. First, run the development server:

Loading…
Cancel
Save