Skip to content

Commit

Permalink
Add global_substitutions to fix github links (#85)
Browse files Browse the repository at this point in the history
(cherry picked from commit fed3b2a)

# Conflicts:
#	conf.py
  • Loading branch information
christophfroehlich authored and mergify[bot] committed Jun 12, 2023
1 parent b2fed09 commit 0a83ac3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@
"sphinx.ext.extlinks",
"sphinx.ext.ifconfig",
"sphinx_copybutton",
<<<<<<< HEAD
"sphinx.ext.viewcode",
=======
"sphinxcontrib.globalsubs"
>>>>>>> fed3b2a (Add global_substitutions to fix github links (#85))
]

# If true, `todo` and `todoList` produce output, else they produce nothing.
Expand Down Expand Up @@ -318,9 +322,18 @@ def smv_rewrite_configs(app, config):
app.config.html_baseurl = app.config.html_baseurl + "/" + distro + "/"
app.config.project = "ROS2_Control: " + distro.title()
app.config.html_logo = "images/logo_ros-controls.png"

# see https://github.com/missinglinkelectronics/sphinxcontrib-globalsubs
app.config.global_substitutions = {
'github_branch': branch,
}
else:
# If we are not building a multiversion build, default to the rolling logo
app.config.html_logo = "images/logo_ros-controls.png"
# see https://github.com/missinglinkelectronics/sphinxcontrib-globalsubs
app.config.global_substitutions = {
'github_branch': 'master',
}


def github_link_rewrite_branch(app, pagename, templatename, context, doctree):
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ sphinx
sphinx-copybutton
sphinx-multiversion
sphinx_rtd_theme
sphinxcontrib-globalsubs

0 comments on commit 0a83ac3

Please sign in to comment.