You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2025/03/24 15:28:20 UTC
(cordova-docs) branch master updated: doc: correct version redirects where possible (#1411)
This is an automated email from the ASF dual-hosted git repository.
erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-docs.git
The following commit(s) were added to refs/heads/master by this push:
new b7563b3ef4 doc: correct version redirects where possible (#1411)
b7563b3ef4 is described below
commit b7563b3ef409c4e87cbc49b6894a52a44ee09663
Author: エリス <er...@users.noreply.github.com>
AuthorDate: Tue Mar 25 00:28:14 2025 +0900
doc: correct version redirects where possible (#1411)
* doc: correct version redirects where possible
* ci: use nodejs 22.x
---
.github/workflows/ci.yml | 3 +++
.github/workflows/deploy.yml | 3 +++
tools/bin/gen_pages_dict.js | 3 +--
www/_layouts/docs.html | 6 ++++--
4 files changed, 11 insertions(+), 4 deletions(-)
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
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 @@ set some constants
{% 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 @@ NOTE:
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 @@ NOTE:
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
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org