diff --git a/docs/_static/js/custom.js b/docs/_static/js/custom.js index 9160efe2251..a5de8716518 100644 --- a/docs/_static/js/custom.js +++ b/docs/_static/js/custom.js @@ -331,7 +331,7 @@ function initBenchmarkPickers() { function addFooter() { const footerAnchor = $('.footer'); - fetch('../footer.html').then((response) => response.text()).then((text) => { + fetch('/footer.html').then((response) => response.text()).then((text) => { const footerContent = $(text); footerAnchor.append(footerContent); }); diff --git a/docs/_static/js/newsletter.js b/docs/_static/js/newsletter.js index 1e42f6a4092..632a818d101 100644 --- a/docs/_static/js/newsletter.js +++ b/docs/_static/js/newsletter.js @@ -4,7 +4,11 @@ newsletterFieldPrefix = 'newsletter-' // debug url // const eloquaUrl = 'https://httpbingo.org/post' - +const currentPath = window.location.pathname.slice(1).split('/'); +const newsletterModalPathVersion = (['cn', 'jp'].includes(currentPath[0])) ? + `/${currentPath[0]}/${currentPath[1]}` : + `/${currentPath[0]}`; +const newsletterModalPath = newsletterModalPathVersion + '/_static/html/newsletter.html'; $(document).ready(function () { const waitForElement = async selector => { @@ -24,7 +28,7 @@ $(document).ready(function () { // }); function showForm() { - fetch('_static/html/newsletter.html').then((response) => response.text()).then((text) => { + fetch(newsletterModalPath).then((response) => response.text()).then((text) => { const newsletter = $('