Skip to content

Commit a8f46eb

Browse files
critesjoshAztecBot
authored andcommitted
cherry-pick: fix(docs): use label-based API version mapping in v4.2.0 aztec-nr api page (with conflicts)
Mechanical cherry-pick of 0e1c474 from PR #22617. The original fix targets docs/developer_versioned_docs/version-v4.2.0/docs/aztec-nr/api.mdx, which does not exist on v4-next. Git's rename detection landed the diff on docs/developer_versioned_docs/version-v4.1.0-rc.2/docs/aztec-nr/api.mdx, producing conflict markers. Committed AS-IS for history; next commit reverts the wrong target and applies the fix to the right file on v4-next.
1 parent 18895d5 commit a8f46eb

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • docs/developer_versioned_docs/version-v4.1.0-rc.2/docs/aztec-nr

docs/developer_versioned_docs/version-v4.1.0-rc.2/docs/aztec-nr/api.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useActiveVersion } from "@docusaurus/plugin-content-docs/client";
1010

1111
export const useApiVersion = () => {
1212
const version = useActiveVersion("developer");
13+
<<<<<<< HEAD:docs/developer_versioned_docs/version-v4.1.0-rc.2/docs/aztec-nr/api.mdx
1314
const versionName = version?.name || "current";
1415
// Map Docusaurus version to API docs folder
1516
// Use stable paths for nightly/devnet, version-specific for others
@@ -18,6 +19,15 @@ export const useApiVersion = () => {
1819
if (versionName.includes("devnet")) return "devnet";
1920
if (versionName.includes("rc") || versionName.includes("testnet")) return "testnet";
2021
return versionName;
22+
=======
23+
if (!version || version.name === "current") return "next";
24+
// Map Docusaurus version to API docs folder using version label
25+
// Labels are set explicitly in docusaurus.config.js (e.g., "Mainnet (...)")
26+
const label = version.label || "";
27+
if (label.startsWith("Alpha")) return "mainnet";
28+
if (label.startsWith("Testnet")) return "testnet";
29+
return version.name;
30+
>>>>>>> 0e1c4740b2 (fix(docs): use label-based API version mapping in v4.2.0 aztec-nr api page):docs/developer_versioned_docs/version-v4.2.0/docs/aztec-nr/api.mdx
2131
};
2232

2333
export const ModuleLink = ({ path, children }) => {

0 commit comments

Comments
 (0)