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:
parent
01b0dd2738
commit
b41e1a1b0d
|
@ -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
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue