Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/vendor/
**/.DS_Store
__pycache__/*
hooks/__pycache__/*
/site/
**/.idea/
.php-cs-fixer.cache
Expand Down
12 changes: 12 additions & 0 deletions hooks/edit_uri.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os

def on_config(config, **kwargs):
if os.environ.get("READTHEDOCS_VERSION_TYPE") == "external":
ref = os.environ.get("READTHEDOCS_GIT_COMMIT_HASH")
else:
ref = os.environ.get("GITHUB_HEAD_REF")

if ref:
config["edit_uri"] = f"blob/{ref}/docs/"

return config
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ INHERIT: plugins.yml

site_name: Developer Documentation
repo_url: https://github.com/ibexa/documentation-developer
edit_uri: edit/5.0/docs
edit_uri: blob/5.0/docs
site_url: https://doc.ibexa.co/en/latest/
hooks:
- hooks/edit_uri.py
copyright: "Copyright 1999-2026 Ibexa AS and others"
validation:
omitted_files: warn
Expand Down
2 changes: 1 addition & 1 deletion theme/partials/source.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% import "partials/language.html" as lang with context %}
<a href="{{ page.edit_url|replace('/edit/', '/blob/') }}" title="{{ lang.t('source.link.title') }}" class="source-github">
<a href="{{ page.edit_url }}" title="{{ lang.t('source.link.title') }}" class="source-github">
<div class="md-source__icon md-icon">
{% include ".icons/fontawesome/brands/github-alt.svg" %}
</div>
Expand Down
Loading