Skip to content

Commit f869d27

Browse files
committed
Fixed instant loading (MkDocs 1.2.2 regression)
1 parent 3b23896 commit f869d27

File tree

13 files changed

+25
-27
lines changed

13 files changed

+25
-27
lines changed

Diff for: material/assets/javascripts/bundle.29db7785.min.js renamed to material/assets/javascripts/bundle.143c17e5.min.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: material/assets/javascripts/bundle.143c17e5.min.js.map

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: material/assets/javascripts/bundle.29db7785.min.js.map

-7
This file was deleted.

Diff for: material/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ <h1>{{ page.title | d(config.site_name, true)}}</h1>
223223
</script>
224224
{% endblock %}
225225
{% block scripts %}
226-
<script src="{{ 'assets/javascripts/bundle.29db7785.min.js' | url }}"></script>
226+
<script src="{{ 'assets/javascripts/bundle.143c17e5.min.js' | url }}"></script>
227227
{% for path in config["extra_javascript"] %}
228228
<script src="{{ path | url }}"></script>
229229
{% endfor %}

Diff for: material/overrides/assets/javascripts/bundle.dba5ec94.min.js renamed to material/overrides/assets/javascripts/bundle.25c9f9b3.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: material/overrides/assets/javascripts/bundle.dba5ec94.min.js.map renamed to material/overrides/assets/javascripts/bundle.25c9f9b3.min.js.map

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: material/overrides/main.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
{% endblock %}
1717
{% block scripts %}
1818
{{ super() }}
19-
<script src="{{ 'overrides/assets/javascripts/bundle.dba5ec94.min.js' | url }}"></script>
19+
<script src="{{ 'overrides/assets/javascripts/bundle.25c9f9b3.min.js' | url }}"></script>
2020
{% endblock %}

Diff for: requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# IN THE SOFTWARE.
2020

2121
# Direct dependencies
22-
mkdocs>=1.1
22+
mkdocs>=1.2.2
2323
Pygments>=2.4
2424
markdown>=3.2
2525
pymdown-extensions>=7.0

Diff for: src/assets/javascripts/_/index.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ export interface Config {
9696
*/
9797
const script = getElementOrThrow("#__config")
9898
const config: Config = JSON.parse(script.textContent!)
99-
config.base = new URL(config.base, getLocation())
100-
.toString()
101-
.replace(/\/$/, "")
99+
config.base = new URL(config.base, getLocation()).toString()
102100

103101
/* ----------------------------------------------------------------------------
104102
* Functions

Diff for: src/assets/javascripts/bundle.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const print$ = watchPrint()
9999
const config = configuration()
100100
const index$ = document.forms.namedItem("search")
101101
? __search?.index || requestJSON<SearchIndex>(
102-
`${config.base}/search/search_index.json`
102+
new URL("search/search_index.json", config.base)
103103
)
104104
: NEVER
105105

Diff for: src/assets/javascripts/integrations/instant/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ function preprocess(urls: string[]): string[] {
120120
/* Replace common prefix (i.e. base) with effective base */
121121
const config = configuration()
122122
return urls.map(url => (
123-
url.replace(root.slice(0, index), `${config.base}/`)
123+
url.replace(root.slice(0, index), config.base)
124124
))
125125
}
126126

@@ -173,7 +173,7 @@ export function setupInstantLoading(
173173
favicon.href = favicon.href
174174

175175
/* Intercept internal navigation */
176-
const push$ = requestXML(`${config.base}/sitemap.xml`)
176+
const push$ = requestXML(new URL("sitemap.xml", config.base))
177177
.pipe(
178178
map(sitemap => preprocess(getElements("loc", sitemap)
179179
.map(node => node.textContent!)

Diff for: src/assets/javascripts/integrations/search/worker/_/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export function setupSearchWorker(
117117
if (isSearchResultMessage(message)) {
118118
for (const result of message.data.items)
119119
for (const document of result)
120-
document.location = `${config.base}/${document.location}`
120+
document.location = `${new URL(document.location, config.base)}`
121121
}
122122
return message
123123
}),

Diff for: src/overrides/assets/javascripts/components/iconsearch/_/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export function mountIconSearch(
8080
): Observable<Component<IconSearch>> {
8181
const config = configuration()
8282
const index$ = requestJSON<IconSearchIndex>(
83-
`${config.base}/overrides/assets/javascripts/iconsearch_index.json`
83+
new URL("overrides/assets/javascripts/iconsearch_index.json", config.base)
8484
)
8585

8686
/* Retrieve query and result components */

0 commit comments

Comments
 (0)