docs: README improvements

PR to add a couple of suggested improvements for **Adding a new documentation page** section
This commit is contained in:
Nicolás Quiroz 2023-01-04 18:25:20 -03:00 committed by GitHub
parent 6a45803ca8
commit db30491147
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,13 +4,10 @@ This is the repository for the `go-ethereum` website. All the website code is he
The purpose of the go-ethereum website is to provide the necessary documentation and supporting information to help users to get up to speed with using go-ethereum (aka "Geth"). The website is maintained by a team of developers but community contributions are also very welcome. The purpose of the go-ethereum website is to provide the necessary documentation and supporting information to help users to get up to speed with using go-ethereum (aka "Geth"). The website is maintained by a team of developers but community contributions are also very welcome.
## Contributing ## Contributing
Contributions from the community are very welcome. Please contribute by cloning the `go-ethereum` repository, checking out the `website` branch and raising pull requests to be reviewed and merged by the repository maintainers. Issues can be raised in the main `go-ethereum` repository using the prefix `[website]: ` in the title. Contributions from the community are very welcome. Please contribute by cloning the `go-ethereum` repository, checking out the `website` branch and raising pull requests to be reviewed and merged by the repository maintainers. Issues can be raised in the main `go-ethereum` repository using the prefix `[website]: ` in the title.
### The geth.ethereum.org stack ### The geth.ethereum.org stack
geth.ethereum.org is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). The following tools were used to build the site: geth.ethereum.org is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). The following tools were used to build the site:
@ -28,26 +25,33 @@ geth.ethereum.org is a [Next.js](https://nextjs.org/) project bootstrapped with
The website code is organized with a top-level `docs` folder that contains all the documentation pages as markdown files. Inside `docs` are subdirectories used to divide the docs by theme (e.g. `getting-started`,`fundamentals`, `developers` etc). Website code is in `src`, and assets including images are in `public`. The website code is organized with a top-level `docs` folder that contains all the documentation pages as markdown files. Inside `docs` are subdirectories used to divide the docs by theme (e.g. `getting-started`,`fundamentals`, `developers` etc). Website code is in `src`, and assets including images are in `public`.
### Adding a new documentation page ### Adding a new documentation page
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.
Notes in documentation pages are highlighted in pale blue boxes. To add a note, wrap the note text in `<Note>` tage as follows: 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.
#### Adding notes to a doc
Notes in documentation pages are highlighted boxes (color depend on the current set dark/light theme). To add a note, wrap the note text in `<Note>` tage as follows:
```markdown ```markdown
<Note> text to include in note</Note> <Note> text to include in note</Note>
``` ```
<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
](https://geth.ethereum.org/docs/fundamentals/account-management) doc
#### Images
Images should be saved to `public/images/docs` and included in the markdown as follows: Images should be saved to `public/images/docs` and included in the markdown as follows:
```markdown ```markdown
![alt-text](/images/docs/image-title.png) ![alt-text](/images/docs/image-title.png)
``` ```
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.
### 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: