summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--theme/assets/website/app.js6
-rw-r--r--theme/javascript/state.js6
-rw-r--r--theme/templates/website/page.html2
3 files changed, 11 insertions, 3 deletions
diff --git a/theme/assets/website/app.js b/theme/assets/website/app.js
index 1230ac8..e8d80d9 100644
--- a/theme/assets/website/app.js
+++ b/theme/assets/website/app.js
@@ -24736,9 +24736,13 @@ state.update = function(dom) {
state.level = $book.data('level');
state.basePath = $book.data('basepath');
state.revision = $book.data('revision');
+ state.filepath = $book.data('filepath');
// Absolute url to the root of the book
- state.root = url.resolve(location.origin, path.dirname(path.resolve(location.pathname, state.basePath)));
+ state.root = url.resolve(
+ location.protocol+'//'+location.host,
+ path.dirname(path.resolve(location.pathname, state.basePath))
+ );
};
state.update($);
diff --git a/theme/javascript/state.js b/theme/javascript/state.js
index 68fafea..5fde20f 100644
--- a/theme/javascript/state.js
+++ b/theme/javascript/state.js
@@ -11,9 +11,13 @@ state.update = function(dom) {
state.level = $book.data('level');
state.basePath = $book.data('basepath');
state.revision = $book.data('revision');
+ state.filepath = $book.data('filepath');
// Absolute url to the root of the book
- state.root = url.resolve(location.origin, path.dirname(path.resolve(location.pathname, state.basePath)));
+ state.root = url.resolve(
+ location.protocol+'//'+location.host,
+ path.dirname(path.resolve(location.pathname, state.basePath))
+ );
};
state.update($);
diff --git a/theme/templates/website/page.html b/theme/templates/website/page.html
index 527e181..c6db959 100644
--- a/theme/templates/website/page.html
+++ b/theme/templates/website/page.html
@@ -14,7 +14,7 @@
{% block description %}{% if progress.current.level == "0" %}{{ description }}{% endif %}{% endblock %}
{% block content %}
- <div class="book" data-level="{{ progress.current.level }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
+ <div class="book" data-level="{{ progress.current.level }}" data-filepath="{{ progress.current.path }}" data-basepath="{{ basePath }}" data-revision="{{ revision }}">
{% include "includes/summary.html" %}
<div class="book-body">
<div class="body-inner">