Skip to content

Commit fc5796c

Browse files
authored
Merge pull request marmelab#10630 from marmelab/fix-doc-tips
[Doc] Fix tips loading in production
2 parents 71aef03 + 57efc04 commit fc5796c

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

docs/js/ra-doc-exec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export const showTip = async () => {
1010
if (!tipElement) return;
1111

1212
const [tips, features] = await Promise.all([
13-
getContents('/assets/tips.md'),
14-
getContents('/assets/features.md'),
13+
getContents('./assets/tips.md'),
14+
getContents('./assets/features.md'),
1515
]);
1616
const all = tips.concat(features);
1717

docs/js/ra-navigation.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@ document.addEventListener('DOMContentLoaded', () => {
153153
'beginner-mode-trigger'
154154
);
155155

156-
if (window.location.pathname === '/documentation.html') {
157-
}
158-
159156
if (beginnerModeTrigger) {
160157
beginnerModeTrigger.addEventListener('click', () => {
161158
beginnerMode = !beginnerMode;
@@ -230,7 +227,7 @@ window.addEventListener('popstate', () => {
230227
return;
231228
}
232229

233-
if (window.location.pathname === '/documentation.html') {
230+
if (window.location.pathname.includes('/documentation.html')) {
234231
fetch(window.location.pathname)
235232
.then(res => res.text())
236233
.then(replaceContent)
@@ -268,7 +265,7 @@ window.addEventListener('DOMContentLoaded', () => {
268265
navigationFitScroll();
269266
loadNewsletterScript();
270267

271-
if (window.location.pathname === '/documentation.html') {
268+
if (window.location.pathname.includes('/documentation.html')) {
272269
import('./ra-doc-exec.js').then(docExecModule => {
273270
document.querySelector('.DocSearch-content').innerHTML = '';
274271
toggleDockBlocks(true);

0 commit comments

Comments
 (0)