Larger contributions with a fork
Editing a single page on GitHub.com is convenient for small text changes, but does not allow you to see a live preview of the site while you are working. It also does not let you easily edit multiple files at once, such as a guide and a reference page or a sidebar entry.
Contribute PRs using an online code editor
(e.g. StackBlitz, CodeSpaces CodeSandbox, Gitpod, IDX)
You can also have a full coding experience editing your own personal copy of the docs repository (a “fork”) in an online IDE (integrated development environment). This will give you a code editor in the browser and a live preview of your site while you work without needing to set up any local development environment.
Each online IDE has its own shortcut URL for opening an existing repository, and will allow you to create pull requests after you have made changes. Many also have browser extensions you can install that will add a “open with” button to the page whenever you are visiting a repository in your browser.
See specific instructions for opening an existing repository in IDX, StackBlitz, and Gitpod on their respective websites.
Note that CodeSandbox and StackBlitz provide Astro syntax highlighting in their custom code editors, while Gitpod supports the full Astro VSCode extension.
Contribute PRs by Developing Locally
To begin developing locally, checkout this project from your machine.
You can install and run the project locally using pnpm. Head to the pnpm installation guide to get that set up. Then, run the following from your terminal:
If you’re copying these instructions, remember to configure this project as a fork.
At any point, create a branch for your contribution. We are not strict about branch names.
Helpful information about Forks
On GitHub you’ll need a “fork” of this repository to work on. This is your own copy where you can make changes. Read more about forks in GitHub’s docs.
Not sure how to get started with GitHub, forks, pull requests, or want a quick refresher? You might want to check out this free video series:
How to Contribute to an Open Source Project on GitHub
Creating a fork
To create your copy, click the Fork button at the top right of any page in this repository.
Maintaining a fork
When you first create your fork, it will be an exact copy of this repository. Over time, withastro/docs
will change as the docs are updated, but your fork won’t automatically stay up-to-date. Here are some ways to keep your fork in sync with this repo.
Manually via the GitHub UI
-
Navigate to your fork on GitHub
-
Click Sync fork and then Update branch
Manually from the command line
In the terminal on your computer:
-
Make sure you’re on the main branch:
git checkout main
-
Fetch and merge updates:
git pull upstream main
-
Push the updates back to your fork on GitHub:
git push origin main
Automatically with a GitHub app
-
Click Install
-
Follow the instructions to select your fork