diff --git a/docs/_static/js/custom.js b/docs/_static/js/custom.js index b876759ffd0..51f9eb605c5 100644 --- a/docs/_static/js/custom.js +++ b/docs/_static/js/custom.js @@ -259,7 +259,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 c9ebc608b35..896810bbac1 100644 --- a/docs/_static/js/newsletter.js +++ b/docs/_static/js/newsletter.js @@ -4,6 +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 => { @@ -23,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 = $('
'); newsletter.attr('id', 'newsletterModal'); newsletter.addClass('newsletterContainer');