From 7a4c6bc326d603197c53fa67073e774af062e998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Tue, 27 Oct 2015 18:44:04 +0100 Subject: [PATCH] Fix calcul of root in gitbook.state when serving index.html as / --- theme/javascript/state.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/javascript/state.js b/theme/javascript/state.js index 5e9083f7b..fb91f7a2e 100644 --- a/theme/javascript/state.js +++ b/theme/javascript/state.js @@ -23,7 +23,7 @@ state.update = function(dom) { // Absolute url to the root of the book state.root = url.resolve( location.protocol+'//'+location.host, - path.dirname(path.resolve(location.pathname, state.basePath)) + path.dirname(path.resolve(location.pathname.replace(/\/$/, '/index.html'), state.basePath)) ); };