Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom URL for edit button link. #528

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/customisation/edit-button.md
Expand Up @@ -12,6 +12,14 @@ html_theme_options = {
}
```

Alternatively, you can manually set an URL that will be used for the edit button link:

```python
html_theme_options = {
"source_edit_link": "_sources/{filename}.txt",
}
```

## Disabling on Read the Docs

If you're building documentation on Read the Docs using a GitHub repository as the source, the edit button is enabled by default. If you wish to disable this, use {ref}`top_of_page_button`.
Expand Down
2 changes: 2 additions & 0 deletions src/furo/theme/furo/components/edit-this-page.html
Expand Up @@ -24,4 +24,6 @@
{%- elif READTHEDOCS and conf_py_path and page_source_suffix and github_user != "None" and github_repo != "None" and github_version %}
{% set url = "https://github.com/" + github_user + "/" + github_repo + "/edit/" + github_version + conf_py_path + pagename + page_source_suffix %}
{{ furo_edit_button(url) }}
{%- elif page_source_suffix %}
{{ furo_edit_button(determine_page_edit_link()) }}
{%- endif -%}
1 change: 1 addition & 0 deletions src/furo/theme/furo/theme.conf
Expand Up @@ -26,3 +26,4 @@ top_of_page_button = edit
source_repository =
source_branch =
source_directory =
source_edit_link =