Edit on GitHub
Allow readers to contribute directly by editing documentation pages on GitHub
The "Edit on GitHub" feature provides a direct link for readers to propose changes to your documentation. This link appears in the table of contents sidebar on every documentation page, making it easy for users to contribute fixes, improvements, or updates.
How It Works
When users click the "Edit this page on GitHub" link, they are taken directly to the source file in your GitHub repository. From there, they can:
- Fork the repository (if they haven't already)
- Make their edits in the GitHub web editor
- Submit a pull request with their changes
This workflow leverages GitHub's built-in editing capabilities, making it straightforward for both technical and non-technical users to contribute.
Configuration
The Edit on GitHub link is automatically generated based on the github object in your geistdocs.tsx configuration file. Set the owner and repo properties to enable this feature:
export const github = {
owner: "your-username",
repo: "your-repo-name",
};If these values are not set, the link will not appear on your documentation pages.
Generated URL Format
The link follows this pattern:
https://github.com/{owner}/{repo}/edit/main/content/docs/{file-path}For example, if your page is located at content/docs/getting-started.mdx, the generated link would be:
https://github.com/your-username/your-repo-name/edit/main/content/docs/getting-started.mdx