Skip to content

Commit

Permalink
Fixed instant loading when used with use_directory_urls: false
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Mar 7, 2021
1 parent 1d790c9 commit 66a6713
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/base.html
Expand Up @@ -217,7 +217,7 @@ <h1>{{ page.title | d(config.site_name, true)}}</h1>
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.d1d4d62b.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.6946554b.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}
Expand Down
6 changes: 3 additions & 3 deletions src/assets/javascripts/integrations/instant/index.ts
Expand Up @@ -105,9 +105,9 @@ function preprocess(urls: string[]): string[] {
return urls

/* Take the first two URLs and remove everything after the last slash */
const [root, next] = urls.slice(0, 2).map(url => (
url.replace(/[^/]+$/, "")
))
const [root, next] = urls
.sort((a, b) => a.length - b.length)
.map(url => url.replace(/[^/]+$/, ""))

/* Compute common prefix */
let index = 0
Expand Down

0 comments on commit 66a6713

Please sign in to comment.