diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d84e0239bc3c..777356358d9f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,9 +48,6 @@ jobs: env: BING_TOKEN: ${{ secrets.BING_TOKEN }} - - name: Add sitemap.xml to root directory - run: mv build/html/en/sitemap.xml build/html - - name: Deploy documentation sphinx uses: JamesIves/github-pages-deploy-action@v4.4.1 if: github.event_name == 'push' && github.ref == 'refs/heads/main' diff --git a/build.py b/build.py index 9e50d513b73b..2af411c391f1 100644 --- a/build.py +++ b/build.py @@ -62,7 +62,7 @@ """ -def build_docs(language: str) -> None: +def build_docs(language: str, isroot: bool) -> None: """ Build the documentation for a single language. @@ -78,7 +78,7 @@ def build_docs(language: str) -> None: "-b", "dirhtml", str(srcdir), - str(outdir / language), + str(outdir) if isroot else str(outdir / language), f"-Dlanguage={language}", ], cwd=root, @@ -97,14 +97,14 @@ def build_redirects(redirects: Dict[str, str], language: str) -> None: language : str The language to build the redirects for. """ - - for source, target in redirects.items(): - source_path = outdir / source - redirect = template.format(target.format(language)) - if not source_path.parent.exists(): - source_path.parent.mkdir(parents=True) - with open(source_path, "w", encoding="utf-8") as fp: - fp.write(redirect) + pass + # for source, target in redirects.items(): + # source_path = outdir / source + # redirect = template.format(target.format(language)) + # if not source_path.parent.exists(): + # source_path.parent.mkdir(parents=True) + # with open(source_path, "w", encoding="utf-8") as fp: + # fp.write(redirect) def build_all(redirects: Dict[str, str], languages: List[str]) -> None: @@ -120,7 +120,7 @@ def build_all(redirects: Dict[str, str], languages: List[str]) -> None: """ for language in languages: - build_docs(language) + build_docs(language, language == languages[0]) build_redirects(redirects, languages[0]) diff --git a/source/_templates/version-switcher.html b/source/_templates/version-switcher.html index a47c356ab750..2f2d6c0e410e 100644 --- a/source/_templates/version-switcher.html +++ b/source/_templates/version-switcher.html @@ -48,62 +48,62 @@ { name: "English", version: "en", - url: "../en/", + url: "", }, { name: "bn", version: "bn", - url: "../bn/", + url: "bn/", }, { name: "cs", version: "cs", - url: "../cs/", + url: "cs/", }, { name: "Deutsch", version: "de", - url: "../de/", + url: "de/", }, { name: "Español", version: "es", - url: "../es/", + url: "es/", }, { name: "Français", version: "fr", - url: "../fr/", + url: "fr/", }, { name: "ja", version: "ja", - url: "../ja/", + url: "ja/", }, { name: "Nederlands", version: "nl", - url: "../nl/", + url: "nl/", }, { name: "pl", version: "pl", - url: "../pl/", + url: "pl/", }, { name: "Português", version: "pt", - url: "../pt/", + url: "pt/", }, { name: "Русский", version: "ru", - url: "../ru/", + url: "ru/", }, { name: "简体中文", version: "zh_CN", - url: "../zh_CN/", + url: "zh_CN/", }, ]; // console.log(data); @@ -116,10 +116,13 @@ const node = document.createElement("a"); node.setAttribute("class", "list-group-item list-group-item-action py-1"); node.textContent = `${entry.name}`; + + node.setAttribute( "href", - `${indexFilePath}${entry.url}${currentFilePath}`, + `https://fortran-lang.org/${entry.url}${currentFilePath}`, ); + // on click, AJAX calls will check if the linked page exists before // trying to redirect, and if not, will redirect to the homepage // for that version of the docs.