Skip to content

Commit f082ca1

Browse files
authored
Update data.js.tmpl
1 parent 041ca2d commit f082ca1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

readthedocs/doc_builder/templates/doc_builder/data.js.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ var doc_slug = "{{ slug }}";
66
var page_name = "{{ pagename }}";
77
var html_theme = "{{ html_theme }}";
88

9-
// mkdocs_page_input_path isn't available on all pages (e.g. search result)
10-
if (mkdocs_page_input_path) {
9+
// mkdocs_page_input_path is only defined on the RTD mkdocs theme but it isn't
10+
// available on all pages (e.g. missing in search result)
11+
if (typeof mkdocs_page_input_path !== "undefined") {
1112
READTHEDOCS_DATA["page"] = mkdocs_page_input_path.substr(
1213
0, mkdocs_page_input_path.lastIndexOf(READTHEDOCS_DATA.source_suffix));
1314
}

0 commit comments

Comments
 (0)