Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions _layouts/website/page.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
{% extends template.self %}

{% block style %}
<script>
// Relative links need the URL that matches the output file. Netlify also serves
// this page at the other form, and redirect rules cannot tell the two apart.
// This runs before the stylesheets so they are not fetched from the wrong URL.
(function () {
var path = location.pathname;
{% if file.path == "README.md" or file.path.endsWith("/README.md") %}
var fixed = /(\/|\.html)$/.test(path) ? path : path + "/";
{% else %}
var fixed = path.replace(/(\.html)?\/+$/, ".html");
{% endif %}
if (fixed !== path) {
location.replace(fixed + location.search + location.hash);
}
})();
</script>
{{ super() }}
{% endblock %}

{% block head %}
{{ super() }}
{% if book.markdownAlternate %}
Expand Down
Loading