ensure repository_name is always set

The repository_name variable wasn't being set in the context, so the
bug link function was failing with an error due to the undefined
variable because the JS variable repositoryName was only conditionally
being created.

Change-Id: I0dccbfe7f02e6fb93ddab4d79cba5d2e9d2d543e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-09-17 09:49:54 -04:00
parent 01b0dd2738
commit b41e1a1b0d
2 changed files with 2 additions and 3 deletions

View File

@ -120,6 +120,7 @@ def _html_page_context(app, pagename, templatename, context, doctree):
doc_path = _get_doc_path(app)
repo_name = app.config.repository_name
_html_context_data['repository_name'] = repo_name
if repo_name and doc_path:
_html_context_data['giturl'] = _giturl.format(repo_name, doc_path)
bug_project = app.config.bug_project

View File

@ -53,9 +53,7 @@
/* gitsha, project and bug_tag rely on variables in conf.py */
var gitSha = "SHA: {{ gitsha }}";
{%- if repository_name %}
var repositoryName = "{{ repository_name }}";
{%- endif %}
var repositoryName = "{{ repository_name }}";
{%- if bug_project %}
var bugProject = "{{ bug_project }}";
{%- endif %}