fix: update developer-hub paths to include /docs#482
fix: update developer-hub paths to include /docs#482AtoMicKraK1n wants to merge 2 commits intometaplex-foundation:mainfrom
Conversation
|
@AtoMicKraK1n is attempting to deploy a commit to the Metaplex Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Summary by CodeRabbit
WalkthroughUpdated documentation index entries and reorganized guide routing: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
public/llms.txt (1)
1-589:⚠️ Potential issue | 🔴 CriticalDo not manually edit this auto-generated file; update the generation script instead.
This file is generated during the build process by
scripts/generate-llms-txt.mjsand written topublic/llms.txt. The build script runs:node scripts/generate-llms-txt.mjs && next buildAny manual edits to
public/llms.txtwill be overwritten on the next build. To make changes, updatescripts/generate-llms-txt.mjsor modify the source markdown files it reads from (src/pages/en).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@public/llms.txt` around lines 1 - 589, The public llms.txt file was manually edited but is auto-generated; revert any manual changes to llms.txt and instead apply your edits to the generator or its sources: update the generation script generate-llms-txt.mjs or the source markdown files used by that script (the "en" pages), then run the canonical build step (node generate-llms-txt.mjs && next build) so the file is regenerated correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/helperComponents/guideIndex.jsx`:
- Line 174: The route entry defined by the path property in guideIndex.jsx
contains a duplicated "/docs/docs/" prefix causing 404s; update the path value
for that entry (the object with path:
'/docs/docs/smart-contracts/core/guides/anchor/how-to-create-a-core-nft-asset-with-anchor')
to remove the extra "/docs" so it reads
'/docs/smart-contracts/core/guides/anchor/how-to-create-a-core-nft-asset-with-anchor',
matching the other paths.
- Line 19: The locale key names in the guideIndex component are mismatched:
replace every use of the nonstandard keys 'jp' and 'kr' (including object keys
like kr: 'Bubblegum V1' and any checks such as locale === 'jp' or locale ===
'kr') with the correct keys 'ja' and 'ko' to match LocaleContext (which returns
'ja' and 'ko'); update all occurrences in the component (e.g., the locale
mapping object and the locale checks/conditionals in the render logic) so Korean
and Japanese translations render correctly.
- Line 28: Replace the local navigation implementation in guideIndex.jsx by
importing getLocalizedHref from '@/config/languages' and Link from 'next/link',
remove the local getLocalizedPath() function, and swap all native <a> usages
(notably the guide links around the code that previously used paths like
'/docs/...') to next/Link components that call getLocalizedHref(...) for their
href; also strip the '/docs/' prefix from those guide path strings
(next/Link/basePath handles it) so Link receives the localized, prefixed href
via getLocalizedHref and you get SPA navigation and preserved scroll position.
---
Outside diff comments:
In `@public/llms.txt`:
- Around line 1-589: The public llms.txt file was manually edited but is
auto-generated; revert any manual changes to llms.txt and instead apply your
edits to the generator or its sources: update the generation script
generate-llms-txt.mjs or the source markdown files used by that script (the "en"
pages), then run the canonical build step (node generate-llms-txt.mjs && next
build) so the file is regenerated correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1178c35b-11a6-4356-b6d9-4ab280e6c524
📒 Files selected for processing (2)
public/llms.txtsrc/components/helperComponents/guideIndex.jsx
| en: 'Bubblegum V1', | ||
| jp: 'Bubblegum V1', | ||
| kr: 'Bubblegum V1' | ||
| kr: 'Bubblegum V1', |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check what locale values are used in the LocaleContext
echo "=== Checking LocaleContext locale values ==="
fd -e js -e jsx LocaleContext --exec cat {} 2>/dev/null | head -50
echo ""
echo "=== Checking locale usage in other components ==="
rg -n "locale === ['\"]" src/ --type js --type jsx -C 1 | head -30Repository: metaplex-foundation/developer-hub
Length of output: 1868
🏁 Script executed:
cat -n src/components/helperComponents/guideIndex.jsx | sed -n '15,35p; 420,440p'Repository: metaplex-foundation/developer-hub
Length of output: 1452
Critical: Fix locale key mismatch that breaks Korean and Japanese translations.
The component uses jp and kr as locale keys (lines 19, 26, etc.), but the LocaleContext returns 'ja' for Japanese and 'ko' for Korean. The locale checks at lines 430 (locale === 'jp') and 432 (locale === 'kr') will never match, preventing Korean and Japanese content from rendering.
Change all jp keys to ja and all kr keys to ko to align with the locale values provided by LocaleContext.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/helperComponents/guideIndex.jsx` at line 19, The locale key
names in the guideIndex component are mismatched: replace every use of the
nonstandard keys 'jp' and 'kr' (including object keys like kr: 'Bubblegum V1'
and any checks such as locale === 'jp' or locale === 'kr') with the correct keys
'ja' and 'ko' to match LocaleContext (which returns 'ja' and 'ko'); update all
occurrences in the component (e.g., the locale mapping object and the locale
checks/conditionals in the render logic) so Korean and Japanese translations
render correctly.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (2)
src/components/helperComponents/guideIndex.jsx (2)
452-454: 🧹 Nitpick | 🔵 TrivialUse
next/LinkwithgetLocalizedHref()for consistent SPA navigation.Native
<a>tags cause full page reloads. The codebase consistently usesnext/LinkwithgetLocalizedHref()from@/config/languagesfor navigation (Header, Footer, Grid components). This also means the localgetLocalizedPath()function (lines 422-425) can be removed.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/helperComponents/guideIndex.jsx` around lines 452 - 454, The anchor tag here causes full page reloads; replace the native <a> with next/Link and pass the localized SPA href using getLocalizedHref(guide.path) (keep the display text from getLocalizedText(guide.name)); update the import to pull in Link and getLocalizedHref from their modules if missing and ensure the Link wraps the getLocalizedText output, and remove the now-unused local helper getLocalizedPath() (lines where getLocalizedPath is defined) to avoid duplication.
18-19:⚠️ Potential issue | 🔴 CriticalLocale key mismatch:
jpandkrshould bejaandko.The
LocaleContextreturns'ja'for Japanese and'ko'for Korean, but this component uses'jp'and'kr'throughout (lines 18-19, 25-26, 46-47, 55-56, 83-84, etc.). The locale checks at lines 430 and 432 (locale === 'jp',locale === 'kr') will never match, breaking Korean and Japanese translations.Replace all
jpkeys withjaand allkrkeys withko.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/helperComponents/guideIndex.jsx` around lines 18 - 19, The component uses nonstandard locale keys 'jp' and 'kr' which never match the LocaleContext's 'ja' and 'ko'; update every occurrence of the 'jp' and 'kr' locale keys and comparisons in guideIndex.jsx (including the translation mapping object entries and any checks like locale === 'jp' / locale === 'kr') to use 'ja' and 'ko' respectively so the LocaleContext matches correctly (ensure you update all occurrences in strings, object keys, and conditional comparisons such as those currently checking locale).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/helperComponents/guideIndex.jsx`:
- Line 28: In src/components/helperComponents/guideIndex.jsx update the guide
objects' path properties to remove the "/docs/" prefix (e.g., change
"/docs/smart-contracts/..." to "/smart-contracts/..."); locate where the array
of guides is defined and update every "path" string (the one shown for the
million-NFT guide) to match the actual pages under src/pages/en
(smart-contracts/, solana/, dev-tools/), ensuring no routes include the "/docs/"
prefix so routing/middleware resolves correctly.
---
Duplicate comments:
In `@src/components/helperComponents/guideIndex.jsx`:
- Around line 452-454: The anchor tag here causes full page reloads; replace the
native <a> with next/Link and pass the localized SPA href using
getLocalizedHref(guide.path) (keep the display text from
getLocalizedText(guide.name)); update the import to pull in Link and
getLocalizedHref from their modules if missing and ensure the Link wraps the
getLocalizedText output, and remove the now-unused local helper
getLocalizedPath() (lines where getLocalizedPath is defined) to avoid
duplication.
- Around line 18-19: The component uses nonstandard locale keys 'jp' and 'kr'
which never match the LocaleContext's 'ja' and 'ko'; update every occurrence of
the 'jp' and 'kr' locale keys and comparisons in guideIndex.jsx (including the
translation mapping object entries and any checks like locale === 'jp' / locale
=== 'kr') to use 'ja' and 'ko' respectively so the LocaleContext matches
correctly (ensure you update all occurrences in strings, object keys, and
conditional comparisons such as those currently checking locale).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e453b3fa-e88a-445a-a44b-7db376b72c57
📒 Files selected for processing (1)
src/components/helperComponents/guideIndex.jsx
| kr: 'Solana에서 100만 NFT 만들기', | ||
| }, | ||
| path: '/smart-contracts/bubblegum/guides/javascript/how-to-create-1000000-nfts-on-solana', | ||
| path: '/docs/smart-contracts/bubblegum/guides/javascript/how-to-create-1000000-nfts-on-solana', |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
echo "=== Checking if /docs/ directory exists in pages ==="
fd -t d "docs" src/pages --max-depth 3
echo ""
echo "=== Checking actual page structure under src/pages/en ==="
tree src/pages/en -L 2 -d 2>/dev/null || ls -la src/pages/en/ 2>/dev/null || echo "Cannot find src/pages/en"
echo ""
echo "=== Checking if smart-contracts pages exist ==="
fd -t d "smart-contracts" src/pages --max-depth 4
echo ""
echo "=== Checking middleware redirect patterns ==="
rg -n "docs" src/middleware.js | head -20 || echo "No /docs/ handling found in middleware"Repository: metaplex-foundation/developer-hub
Length of output: 1058
🏁 Script executed:
cat -n src/components/helperComponents/guideIndex.jsx | sed -n '20,35p'Repository: metaplex-foundation/developer-hub
Length of output: 664
🏁 Script executed:
rg -n "/docs/" src/components/helperComponents/guideIndex.jsx | head -10Repository: metaplex-foundation/developer-hub
Length of output: 980
Remove the /docs/ prefix from guide paths—pages are not located under a /docs/ directory.
The page structure in src/pages/en/ contains directories like smart-contracts/, solana/, and dev-tools/ directly. Adding the /docs/ prefix (e.g., /docs/smart-contracts/bubblegum/guides/javascript/...) breaks routing because:
- No
/docs/directory exists in the pages structure - The middleware has no handling for
/docs/prefix rewriting - These paths will attempt to access non-existent pages and return 404 errors
The paths should remain as /smart-contracts/..., /solana/..., /dev-tools/... without the prefix.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/helperComponents/guideIndex.jsx` at line 28, In
src/components/helperComponents/guideIndex.jsx update the guide objects' path
properties to remove the "/docs/" prefix (e.g., change
"/docs/smart-contracts/..." to "/smart-contracts/..."); locate where the array
of guides is defined and update every "path" string (the one shown for the
million-NFT guide) to match the actual pages under src/pages/en
(smart-contracts/, solana/, dev-tools/), ensuring no routes include the "/docs/"
prefix so routing/middleware resolves correctly.
Description
Fixed broken navigation in the Solana section where links were missing the /docs prefix, causing incorrect redirects to the homepage.
Changes:
Updated internal paths to include /docs.
Verified links now resolve correctly instead of redirecting to metaplex.com.