From 8c0be2c0a23f41497045d4339a917dfa4adad459 Mon Sep 17 00:00:00 2001 From: Erisu Date: Sat, 22 Mar 2025 02:03:17 +0900 Subject: [PATCH 1/2] doc: correct version redirects where possible --- tools/bin/gen_pages_dict.js | 3 +-- www/_layouts/docs.html | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/bin/gen_pages_dict.js b/tools/bin/gen_pages_dict.js index 8f0751af79..2e678a47f9 100644 --- a/tools/bin/gen_pages_dict.js +++ b/tools/bin/gen_pages_dict.js @@ -40,7 +40,7 @@ const LATEST_ALIAS_URI = '/latest/'; function pathToURI (filePath, rootPath) { return filePath .replace(new RegExp('^' + rootPath), '') - .replace(/\\.md$/, '.html'); + .replace(/\.md$/, '.html'); } function pagesFromRedirects (redirects, languages) { @@ -88,7 +88,6 @@ function main () { // add entries for all Markdown files in the site root const allMarkdownFiles = path.join(siteRootPath, '**/*.md'); fs.glob(allMarkdownFiles, function (error, filePaths) { - console.log(filePaths); if (error) throw error; for (let i = 0; i < filePaths.length; i++) { diff --git a/www/_layouts/docs.html b/www/_layouts/docs.html index b2ab0d53ed..87617dafe8 100644 --- a/www/_layouts/docs.html +++ b/www/_layouts/docs.html @@ -18,6 +18,8 @@ {% assign MY_ENTRY = page.url | replace: VERSION_ROOT,"" %} {% assign my_entry_parts = MY_ENTRY | split: "/" %} +{% assign page_url = "/" | append: page.path | replace: ".md", ".html" %} + {% comment %} PATH_TO_ROOT: path from here to version root, replacing all parts except the last one with '../' NOTE: @@ -152,7 +154,7 @@ layouts change from version to version {% endcomment %} {% capture other_version_root %}/docs/{{ page.language }}/{{ other_version_string }}/{% endcapture %} - {% assign other_version_url = page.url | replace:VERSION_ROOT,other_version_root %} + {% assign other_version_url = page_url | replace:VERSION_ROOT,other_version_root %} {% unless ALL_PAGES contains other_version_url %} {% assign other_version_url = other_version_root %} @@ -177,7 +179,7 @@ Get URL for this page in the latest version {% endcomment %} {% capture latest_root %}/docs/{{ page.language }}/latest/{% endcapture %} - {% assign latest_url = page.url | replace:VERSION_ROOT,latest_root %} + {% assign latest_url = page_url | replace:VERSION_ROOT,latest_root %} {% comment %} If this page doesn't exist, just use root From c1d95ff11927049cb5f2daf410b0ec1cecbecaf4 Mon Sep 17 00:00:00 2001 From: Erisu Date: Sat, 22 Mar 2025 02:24:14 +0900 Subject: [PATCH 2/2] ci: use nodejs 22.x --- .github/workflows/ci.yml | 3 +++ .github/workflows/deploy.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4d1b8deb5..fca021ce7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,9 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x - uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7bc3f31938..88d00b6be6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,6 +17,9 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22.x - uses: ruby/setup-ruby@v1 with: ruby-version: 2.7