Skip to content

Commit

Permalink
docs: prepare for v2 docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser committed Jul 1, 2024
1 parent 93e5078 commit 06a479b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
4 changes: 2 additions & 2 deletions www/apps/api-reference/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ NEXT_PUBLIC_ENV=
NEXT_PUBLIC_BASE_URL=
NEXT_PUBLIC_DOCS_URL=
NEXT_PUBLIC_UI_URL=
NEXT_PUBLIC_DOCS_V2_URL=
NEXT_PUBLIC_API_V2_URL=
ALGOLIA_WRITE_API_KEY=
NEXT_PUBLIC_AI_ASSISTANT_URL=
NEXT_PUBLIC_AI_WEBSITE_ID=
NEXT_PUBLIC_AI_API_ASSISTANT_RECAPTCHA_SITE_KEY=
NEXT_PUBLIC_VERSIONING=
NEXT_PUBLIC_AI_API_ASSISTANT_RECAPTCHA_SITE_KEY=
6 changes: 1 addition & 5 deletions www/apps/api-reference/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ const Navbar = () => {
setMobileSidebarOpen,
mobileSidebarOpen,
}}
additionalActionsBefore={
<>
{process.env.NEXT_PUBLIC_VERSIONING === "true" && <VersionSwitcher />}
</>
}
additionalActionsBefore={<VersionSwitcher />}
additionalActionsAfter={<FeedbackModal />}
isLoading={isLoading}
/>
Expand Down
18 changes: 10 additions & 8 deletions www/apps/api-reference/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ const nextConfig = {
source: "/ui/:path*",
destination: `${process.env.NEXT_PUBLIC_UI_URL}/ui/:path*`,
},
{
source: "/v2",
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2`,
},
{
source: "/v2/:path*",
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2/:path*`,
},
{
source: "/:path*",
destination: `${process.env.NEXT_PUBLIC_DOCS_URL}/:path*`,
}
},
]
if (process.env.NEXT_PUBLIC_VERSIONING === "true") {
rewriteFallbacks.push({
source: "/v2/:path*",
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2/:path*`,
})
}
return {
fallback: rewriteFallbacks
fallback: rewriteFallbacks,
}
},
webpack: (config) => {
Expand Down
11 changes: 11 additions & 0 deletions www/apps/docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,17 @@ const config = {
target: "_blank",
position: "left",
},
{
type: "html",
position: "left",
value: "<div class='h-1 w-px bg-medusa-fg-disabled'></div>",
},
{
href: `https://docs.medusajs.com/v2`,
html: "<div class='flex gap-0.5'><span>Learn Medusa v2</span><span class='text-compact-x-small-plus px-docs_0.25 py-0 rounded-docs_sm border border-solid text-center bg-medusa-tag-blue-bg text-medusa-tag-blue-text border-medusa-tag-blue-border'>New</span></div>",
target: "_blank",
position: "left",
},
{
type: "search",
position: "right",
Expand Down

0 comments on commit 06a479b

Please sign in to comment.