diff --git a/clang-tools-extra/clang-doc/HTMLGenerator.cpp b/clang-tools-extra/clang-doc/HTMLGenerator.cpp index 3fc89311749ad..1af555a5b772b 100644 --- a/clang-tools-extra/clang-doc/HTMLGenerator.cpp +++ b/clang-tools-extra/clang-doc/HTMLGenerator.cpp @@ -120,6 +120,13 @@ Error HTMLGenerator::setupTemplateResources(const ClangDocContext &CDCtx, SCA->emplace_back(JsPath); } V.getAsObject()->insert({"Scripts", ScriptArr}); + if (RelativeRootPath.empty()) { + RelativeRootPath = ""; + } else { + sys::path::append(RelativeRootPath, "/index.html"); + sys::path::native(RelativeRootPath, sys::path::Style::posix); + } + V.getAsObject()->insert({"Homepage", RelativeRootPath}); return Error::success(); } diff --git a/clang-tools-extra/clang-doc/assets/navbar-template.mustache b/clang-tools-extra/clang-doc/assets/navbar-template.mustache index 178d147a556d3..2767d5af86668 100644 --- a/clang-tools-extra/clang-doc/assets/navbar-template.mustache +++ b/clang-tools-extra/clang-doc/assets/navbar-template.mustache @@ -8,10 +8,7 @@
diff --git a/clang-tools-extra/test/clang-doc/basic-project.mustache.test b/clang-tools-extra/test/clang-doc/basic-project.mustache.test index d406c9f297960..26e42280f3474 100644 --- a/clang-tools-extra/test/clang-doc/basic-project.mustache.test +++ b/clang-tools-extra/test/clang-doc/basic-project.mustache.test @@ -25,10 +25,7 @@ HTML-SHAPE: HTML-SHAPE: @@ -135,10 +132,7 @@ HTML-CALC: HTML-CALC: @@ -339,10 +333,7 @@ HTML-RECTANGLE: HTML-RECTANGLE: @@ -457,10 +448,7 @@ HTML-CIRCLE: HTML-CIRCLE: