diff --git a/docs/conf.py b/docs/conf.py index 9ebe567..67677d6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,8 @@ # noqa: D100 from __future__ import annotations +import os + project = "FMF-Jinja" author = "Cristian Le" extensions = [ @@ -37,9 +39,12 @@ "https://jinja.palletsprojects.com/en/stable", ] autodoc_member_order = "bysource" -# TODO: Make extlinks git reference aware + +repo_slug = os.getenv("GITHUB_REPOSITORY", "LecrisUT/fmf-jinja") +git_ref = os.getenv("GITHUB_REF_NAME", "main") + extlinks = { "issue": ("https://github.com/LecrisUT/fmf-jinja/issues/%s", "issue %s"), - "path": ("https://github.com/LecrisUT/fmf-jinja/tree/main/%s", "%s"), + "path": (f"https://github.com/{repo_slug}/tree/{git_ref}/%s", "%s"), "user": ("https://github.com/%s", "%s"), }