From 3ae387dbee726542eb1ab71dd2eec4339b7a6f46 Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Fri, 24 Sep 2021 21:33:42 +0000 Subject: [PATCH 1/2] migration portal redirects fixes (copy-paste most likely) --- .../3.3.0/04_mp_migrating_database/02_mp_schema_assessment.mdx | 2 +- .../3.3.0/04_mp_migrating_database/03_mp_schema_migration.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/product_docs/docs/migration_portal/3.3.0/04_mp_migrating_database/02_mp_schema_assessment.mdx b/product_docs/docs/migration_portal/3.3.0/04_mp_migrating_database/02_mp_schema_assessment.mdx index e0f913d13ec..5b7fa8bf18e 100644 --- a/product_docs/docs/migration_portal/3.3.0/04_mp_migrating_database/02_mp_schema_assessment.mdx +++ b/product_docs/docs/migration_portal/3.3.0/04_mp_migrating_database/02_mp_schema_assessment.mdx @@ -4,7 +4,7 @@ title: "Performing a Schema Assessment" redirects: - /migration_portal/3.0.1/04_mp_migrating_database/02_mp_schema_assessment/ - /migration_portal/3.1.0/04_mp_migrating_database/02_mp_schema_assessment/ - - /migration_portal/3.2.0/04_mp_migrating_database/04_mp_data_migration/ + - /migration_portal/3.2.0/04_mp_migrating_database/02_mp_schema_assessment/ legacyRedirectsGenerated: # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. diff --git a/product_docs/docs/migration_portal/3.3.0/04_mp_migrating_database/03_mp_schema_migration.mdx b/product_docs/docs/migration_portal/3.3.0/04_mp_migrating_database/03_mp_schema_migration.mdx index abbd3e298d6..444ad75a675 100644 --- a/product_docs/docs/migration_portal/3.3.0/04_mp_migrating_database/03_mp_schema_migration.mdx +++ b/product_docs/docs/migration_portal/3.3.0/04_mp_migrating_database/03_mp_schema_migration.mdx @@ -4,7 +4,7 @@ title: "Schema Migration" redirects: - /migration_portal/3.0.1/04_mp_migrating_database/03_mp_schema_migration/ - /migration_portal/3.1.0/04_mp_migrating_database/03_mp_schema_migration/ - - /migration_portal/3.2.0/04_mp_migrating_database/04_mp_data_migration/ + - /migration_portal/3.2.0/04_mp_migrating_database/03_mp_schema_migration/ legacyRedirectsGenerated: # This list is generated by a script. If you need add entries, use the `legacyRedirects` key. From 2eaaa7d9f58dd3b0433add575f9ba370670c80db Mon Sep 17 00:00:00 2001 From: Josh Heyer <63653723+josh-heyer@users.noreply.github.com> Date: Fri, 24 Sep 2021 21:34:49 +0000 Subject: [PATCH 2/2] Fix auto-gen redirects for pglogical to allow existing links to work without issue --- .../docs/pglogical/3.7/subscriptions/index.mdx | 2 -- .../3.7/subscriptions/pglogical-writer.mdx | 2 +- scripts/source/pglogical.js | 16 +++++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/product_docs/docs/pglogical/3.7/subscriptions/index.mdx b/product_docs/docs/pglogical/3.7/subscriptions/index.mdx index 011f84d7054..29d03dd4650 100644 --- a/product_docs/docs/pglogical/3.7/subscriptions/index.mdx +++ b/product_docs/docs/pglogical/3.7/subscriptions/index.mdx @@ -2,8 +2,6 @@ navigation: - subscriptions - pglogical-writer -redirects: - - ../subscriptions navTitle: Subscriptions title: Subscription Overview originalFilePath: subscriptions.md diff --git a/product_docs/docs/pglogical/3.7/subscriptions/pglogical-writer.mdx b/product_docs/docs/pglogical/3.7/subscriptions/pglogical-writer.mdx index e74d9caac3c..0521b10122f 100644 --- a/product_docs/docs/pglogical/3.7/subscriptions/pglogical-writer.mdx +++ b/product_docs/docs/pglogical/3.7/subscriptions/pglogical-writer.mdx @@ -1,6 +1,6 @@ --- redirects: - - ../pglogical-writer + - ../../pglogical-writer navTitle: pglogical Writer title: pglogical writer originalFilePath: pglogical-writer.md diff --git a/scripts/source/pglogical.js b/scripts/source/pglogical.js index 1cdef283e44..55a7c158a0b 100644 --- a/scripts/source/pglogical.js +++ b/scripts/source/pglogical.js @@ -5,9 +5,9 @@ const path = require("path"); const fs = require("fs/promises"); const { read, write } = require("to-vfile"); -const remarkParse = require("@mdx-js/mdx/node_modules/remark-parse"); +const remarkParse = require("remark-parse"); const mdx = require("remark-mdx"); -const unified = require("@mdx-js/mdx/node_modules/unified"); +const unified = require("unified"); const remarkFrontmatter = require("remark-frontmatter"); const remarkStringify = require("remark-stringify"); const admonitions = require("remark-admonitions"); @@ -42,11 +42,13 @@ const basePath = path.resolve("temp_pglogical3/docs/"); { if (subDest && !(subDest instanceof Array)) { - if (!subIndexFilename) subIndexFilename = subDest; - fileToMetadata[subDest] = { - ...fileToMetadata[subDest], - redirects: ["../" + path.basename(subDest, ".md")] - }; + if (!subIndexFilename) + subIndexFilename = subDest; + else + fileToMetadata[subDest] = { + ...fileToMetadata[subDest], + redirects: ["../../" + path.basename(subDest, ".md")] + }; } } }