Polygon is a scaling solution for public blockchains that combines the best of Ethereum and sovereign Blockchains into a full-stack scaling solution.
Polygon documentation website is built using Docusaurus, a modern static website generator.
We believe one of the things that makes Polygon special is its coherent design and we seek to retain this defining characteristic. From the outset we defined some guidelines to ensure new contributions only ever enhance the Documentation.
Note that on macOS you also need Xcode and Command Line Tools.
-
Fork the Repo, check how to fork the repo
-
Clone your forked repo
git clone [email protected]:[your_github_handle]/matic-docs
-
Navigate into the cloned folder
cd matic-docs
-
If you have already forked the repo, you need to ensure that the fork is configured and up to date to avoid potential merge conflicts. Check how to configure your fork
git remote add upstream https://github.com/maticnetwork/matic-docs
Sync your fork with the latest changes:
git checkout master git fetch upstream git merge upstream/master
-
Install all dependencies
yarn install
-
Run docs locally, this command starts a local development server and opens up a browser window http://localhost:3000. Most changes are reflected live without having to restart the server:
yarn start
After running the docs locally on your machine, you need to use a code editor such as Atom to start applying your changes and then submit your PR using a Github tool such as GitHub Desktop. Please, fork our docs repo and create a new GitHub brunch for each PR that you want to make.
-
Create new branch for your changes
$ git checkout -b [new_branch_name]
-
Commit and prepare for pull request (PR). In your PR commit message, reference the issue it resolves. check how to link a commit message to an issue using a keyword and our Git-Rules
$ git commit -m "brief description of changes [Fixes #1234]"
-
Push to your GitHub account
$ git push
-
Submit a pull request (PR) to the
master
branch of thematicnetwork/matic-docs
repo (only after your changes are commited to your GitHub fork) -
In your PR description, reference the issue it resolves. Check linking a pull request to an issue using a keyword
-
Add a name to your Commit changes (PR request). For example, if you want to suggest editing to the page Getting Started, you need to name your PR Update /docs/develop/getting-started.md
-
Write a brief description of changes you have made (add screenshots and references if possible)
Note that for editing suggestions you must have a Github account and good knowledge of Markdown syntax.
You can apply UI changes, sidebar and configuration design, through the following files:
- To modify the Sidebar navigation, you will need to apply changes to the file sidebars.js
- To modify the website page layout, you will need to apply changes to the file docusaurus.config.js
- To modify the blocks structure and the footer links, you will need to apply changes to the file src/pages/index.js
You can easily submit an edit suggestion:
- Navigate to the Polygon documentation page that you want to edit
- Scroll down until the end of that page
- Click on the button Edit this page, it will forward you to the same page (markdown format) hosted on Github
- On the related Github page, click on the button Edit this file
- Apply your edits suggestions by modifying the Markdown file
- After you finish your editing, scroll down until the end of that page
- Add a name to your Commit changes (PR request). For example, if you want to suggest editing to the page Getting Started you need to name your PR Update /docs/develop/getting-started.md
- Click on the green button Propose channges to submit your changes in the form of a new PR. Note that submitting a change will write it to a new branch in your fork, so you can send a pull request.
- After that we will review your PR and either accept it or submit our review on it. Acceptable PRs will be approved & merged into the
master
branch
- Create a new issue to report a bug, request a feature, or suggest changes
- Comment on the issue if you want to be assigned to it so our team can assign the issue to you.
- If you do not have a specific contribution in mind, you can also browse current issues.
- Issues that additionally have the
good first issue
label are considered ideal for first-timers
This command generates static content into the build
directory and can be served using any static contents hosting service:
$ yarn build
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the gh-pages
branch.
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy