✏️ Edit this page#
Display an “Edit this page” link allowing readers to contribute fixes directly on your repository.
Configuration#
Configure edit links via html_context in conf.py. This component supports GitHub, GitLab, and Bitbucket out of the box.
html_context = {
"github_user": "your-username",
"github_repo": "your-repo",
"github_version": "main",
"doc_path": "docs",
}
html_context = {
"gitlab_user": "your-username",
"gitlab_repo": "your-repo",
"gitlab_version": "main",
"doc_path": "docs",
}
html_context = {
"bitbucket_user": "your-username",
"bitbucket_repo": "your-repo",
"bitbucket_version": "main",
"doc_path": "docs",
}
Configuration options#
Key |
Description |
|---|---|
|
Your username or organization name |
|
Repository name |
|
Branch name (defaults to |
|
Path to documentation folder within your repository |
Custom source URL#
For self-hosted instances or other providers, use a custom URL pattern with %s as placeholder:
html_context = {
"source_edit_url": "https://git.example.com/user/repo/edit/main/docs/%s",
}
The %s placeholder is replaced with the full path to the source file (e.g., user_guide/quickstart.md).
Styling#
Customize the link appearance with CSS variables:
:root {
--bz-edit-this-page-color: var(--bz-link-color);
--bz-edit-this-page-color-hover: var(--bz-link-color-hover);
--bz-edit-this-page-font-size: inherit;
--bz-edit-this-page-font-family: inherit;
}