Fix "Up" links to top-level index

When the docs are viewed locally, the URL ".." causes the browser to
display a listing of the parent directory, instead of "../index.html".
The "../index.html" interpretation is only provided by web servers.
This commit is contained in:
Anton Bachin 2017-10-11 10:21:44 -05:00
parent 08050696fb
commit 9e3b64af86
1 changed files with 1 additions and 1 deletions

View File

@ -66,7 +66,7 @@ let lib_index sctx ~odoc ~dir ~(lib : Library.t) ~lib_public_name ~doc_dir ~modu
let context = SC.context sctx in
let generated_index_mld = dir ++ sprintf "%s-generated.mld" lib.name in
let source_index_mld = dir ++ sprintf "%s.mld" lib.name in
let header = {|{%html:<nav><a href="..">Up</a></nav>%}|} in
let header = {|{%html:<nav><a href="../index.html">Up</a></nav>%}|} in
SC.add_rule sctx
(Build.if_file_exists source_index_mld
~then_:(Build.contents source_index_mld