diff --git a/advocacy_docs/edb-postgres-ai/console/using/organizations/identity_provider/index.mdx b/advocacy_docs/edb-postgres-ai/console/using/organizations/identity_provider/index.mdx index b64ded13bca..e40a26f6a21 100644 --- a/advocacy_docs/edb-postgres-ai/console/using/organizations/identity_provider/index.mdx +++ b/advocacy_docs/edb-postgres-ai/console/using/organizations/identity_provider/index.mdx @@ -59,7 +59,7 @@ On the Set Up Identity Provider page: For example: - ![](../images/nameID.png) + ![](images/nameID.png) 3. In the **SAML settings** section, enter the configuration information for your preferred SAML identity provider: | Field | Description | diff --git a/product_docs/docs/postgres_distributed_for_kubernetes/1/identify_images/private_registries.mdx b/product_docs/docs/postgres_distributed_for_kubernetes/1/identify_images/private_registries.mdx index 87b57313330..445666507a6 100644 --- a/product_docs/docs/postgres_distributed_for_kubernetes/1/identify_images/private_registries.mdx +++ b/product_docs/docs/postgres_distributed_for_kubernetes/1/identify_images/private_registries.mdx @@ -43,7 +43,7 @@ log in to the EDB container registry, for example, through `docker login` or a In the [repos page in EDB](https://www.enterprisedb.com/repos-downloads), is an EDB Repos 2.0 section where a repo token appears obscured. -![EDB Repo Portal](images/edb-repo-portal.png) +![EDB Repo Portal](../images/edb-repo-portal.png) Next to the repo token is a **Copy Token** button to copy the token and an eye icon for looking at the content of the token. diff --git a/tools/automation/actions/link-check/index.js b/tools/automation/actions/link-check/index.js index b3b97d0edfb..8642e709984 100644 --- a/tools/automation/actions/link-check/index.js +++ b/tools/automation/actions/link-check/index.js @@ -16,6 +16,7 @@ import GithubSlugger from "github-slugger"; import toVfile from "to-vfile"; const { read, write } = toVfile; +const imageExts = [".png", ".svg", ".jpg", ".jpeg", ".gif"]; const docsUrl = "https://www.enterprisedb.com/docs"; // add path here to ignore link warnings const noWarnPaths = [ @@ -158,6 +159,30 @@ async function main() { await scanner.run(ast, input); } + const imageFiles = await glob( + imageExts.flatMap((ext) => [ + "product_docs/**/*" + ext, + "advocacy_docs/**/*" + ext, + ]), + ); + + for (const sourcePath of imageFiles) { + const metadata = { + canonical: fsPathToURLPath(sourcePath), + index: false, + slugs: [], + redirects: [], + source: sourcePath, + }; + allValidUrlPaths.set(metadata.canonical, metadata); + if (isVersioned(sourcePath)) { + const splitPath = metadata.canonical.split(path.posix.sep); + metadata.product = splitPath[1]; + metadata.version = splitPath[2]; + allValidUrlPaths.set(latestVersionURLPath(sourcePath), metadata); + } + } + // compile product versions const productVersions = {}; @@ -356,9 +381,16 @@ function cleanup() { const mapUrlToCanonical = (url, position) => { let test = normalizeUrl(url, metadata.canonical, metadata.index); + if ( + test.href === + docsUrl + "/edb-postgres-ai/analytics/images/level-50.png" + ) + debugger; if (!test.href.startsWith(docsUrl)) return url; if (test.href === docsUrl) return url; - if (path.posix.extname(test.pathname)) return url; + const ext = path.posix.extname(test.pathname); + const isImageUrl = imageExts.includes(ext); + if (ext && !isImageUrl) return url; metadata.linksChecked = metadata.linksChecked || 0 + 1; @@ -440,7 +472,7 @@ function cleanup() { return url; }; - visitParents(tree, ["link", "element"], (node) => { + visitParents(tree, ["link", "image", "element"], (node) => { try { if ( node.type === "element" && @@ -451,7 +483,7 @@ function cleanup() { node.properties.href, node.position, ); - else if (node.type === "link") + else if (node.type === "link" || node.type === "image") node.url = mapUrlToCanonical(node.url, node.position); } catch (e) { file.message(e, node.position); @@ -494,11 +526,14 @@ function fsPathToURLPath(fsPath) { // 2. strip trailing index.mdx // 3. strip trailing .mdx // 4. strip trailing / + // URL encode const docsLocations = /product_docs\/docs|advocacy_docs/; - return fsPath - .split(docsLocations)[1] - .replace(/\/index\.mdx$|\.mdx$/, "") - .replace(/\/$/, ""); + return encodeURI( + fsPath + .split(docsLocations)[1] + .replace(/\/index\.mdx$|\.mdx$/, "") + .replace(/\/$/, ""), + ); } function latestVersionURLPath(fsPath) {