Skip to content

Commit

Permalink
Fix undefined link suffix for v5.9 and v5.10
Browse files Browse the repository at this point in the history
This issue was caused by too new of a version of sphinx being used with
too old of a version of sphinx_rtd_theme, for which we have a copy
residing in ParaView.

The older sphinx_rtd_theme was unaware of the
`DOCUMENTATION_OPTIONS.LINK_SUFFIX`, and it therefore was undefined.

This is the same fix performed in `fish-shell` in [this commit](fish-shell/fish-shell@58885fb).

The issue would cause broken search result links, where clicking on a
link would include "undefined" in the url. This patch seems to fix the
issue.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
  • Loading branch information
psavery committed Mar 25, 2022
1 parent 0dcb642 commit 3cb9a70
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion v5.10.0/python/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ var Search = {
} else {
// normal html builders
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;
// If LINK_SUFFIX is undefined, default to ".html"
linkUrl = item[0] + (DOCUMENTATION_OPTIONS.LINK_SUFFIX || ".html");
}
listItem.append($('<a/>').attr('href',
linkUrl +
Expand Down
3 changes: 2 additions & 1 deletion v5.10.1/python/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ var Search = {
} else {
// normal html builders
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;
// If LINK_SUFFIX is undefined, default to ".html"
linkUrl = item[0] + (DOCUMENTATION_OPTIONS.LINK_SUFFIX || ".html");
}
listItem.append($('<a/>').attr('href',
linkUrl +
Expand Down
3 changes: 2 additions & 1 deletion v5.9.0/python/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ var Search = {
} else {
// normal html builders
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;
// If LINK_SUFFIX is undefined, default to ".html"
linkUrl = item[0] + (DOCUMENTATION_OPTIONS.LINK_SUFFIX || ".html");
}
listItem.append($('<a/>').attr('href',
linkUrl +
Expand Down
3 changes: 2 additions & 1 deletion v5.9.1/python/_static/searchtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ var Search = {
} else {
// normal html builders
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;
// If LINK_SUFFIX is undefined, default to ".html"
linkUrl = item[0] + (DOCUMENTATION_OPTIONS.LINK_SUFFIX || ".html");
}
listItem.append($('<a/>').attr('href',
linkUrl +
Expand Down

0 comments on commit 3cb9a70

Please sign in to comment.