-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite references to internal repo for P4K to public docs
- Loading branch information
1 parent
890b732
commit 89878ce
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
scripts/fileProcessor/processors/cnp/replace-github-urls.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Replace URLs beginning with the following patterns... | ||
// - https://github.com/EnterpriseDB/cloud-native-postgres/tree/main/docs/ | ||
// - https://raw.githubusercontent.com/EnterpriseDB/cloud-native-postgres/main/docs/src/ | ||
// ...with equivalent URLs referencing postgres for kubernetes in the public EDB Docs repo | ||
|
||
const replacements = [ | ||
{pattern: /https:\/\/github\.com\/EnterpriseDB\/cloud-native-postgres\/tree\/main\/docs\//g, replacement: "https://github.com/EnterpriseDB/docs/tree/main/product_docs/docs/postgres-for-kubernetes/latest/"}, | ||
{pattern: /https:\/\/github\.com\/EnterpriseDB\/cloud-native-postgres\/blob\/main\/docs\//g, replacement: "https://github.com/EnterpriseDB/docs/blob/main/product_docs/docs/postgres-for-kubernetes/latest/"}, | ||
{pattern: /https:\/\/raw\.githubusercontent\.com\/EnterpriseDB\/cloud-native-postgres\/main\/docs\/src\//g, replacement: "https://raw.githubusercontent.com/EnterpriseDB/docs/main/product_docs/docs/postgres-for-kubernetes/latest/"}, | ||
]; | ||
|
||
export const process = (filename, content) => { | ||
for (const r of replacements) | ||
content = content.replace(r.pattern, r.replacement); | ||
|
||
return { | ||
newFilename: filename, | ||
newContent: content, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters