This repository contains the documentation for Artifacts, an API-based MMORPG. The documentation is built using Nextra, a static site generator built on top of Next.js.
- Node.js 16+
- npm or yarn package manager
-
Clone the repository
git clone https://github.com/MuigetsuVB/artifacts-docs.git cd artifacts-docs -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser Navigate to
http://localhost:3000to see the documentation site.
npm run dev- Start development servernpm run build- Build the site for productionnpm run start- Start the production server
artifacts-docs/
├── pages/ # Documentation pages
│ ├── _meta.json # Root navigation configuration
│ ├── index.mdx # Homepage
│ ├── quickstart/ # Quickstart guide pages
│ │ ├── _meta.json # Quickstart navigation
│ │ ├── introduction.mdx
│ │ ├── first_fight.mdx
│ │ └── ...
│ ├── concepts/ # Game concepts pages
│ ├── api_guide/ # API guide pages
│ ├── resources/ # Resources pages
│ └── others/ # Other pages
├── theme.config.tsx # Nextra theme configuration
├── next.config.js # Next.js configuration
└── package.json # Dependencies and scripts
-
Create a new
.mdxfile in the appropriate directory underpages/:# Example: Add a new concept page touch pages/concepts/my-new-concept.mdx -
Add basic content to your new file:
# My New Concept This is a new documentation page about an important concept. ## Overview Explain your concept here...
-
Update the navigation by editing the corresponding
_meta.jsonfile:{ "actions": "Actions", "maps_and_movement": "Maps and Movement", "my-new-concept": "My New Concept", "skills": "Skills" }
- Find the file you want to edit in the
pages/directory - Edit the
.mdxfile using Markdown syntax with MDX extensions - Save the file - changes will be reflected immediately in development mode
-
Create a new directory under
pages/:mkdir pages/my-new-section
-
Create a
_meta.jsonfile for navigation:{ "page-one": "First Page", "page-two": "Second Page" } -
Add pages to the directory:
touch pages/my-new-section/page-one.mdx touch pages/my-new-section/page-two.mdx
-
Update the root navigation in
pages/_meta.json:{ "index": "Introduction", "quickstart": "Quickstart", "my-new-section": "My New Section", "concepts": "Game concepts" }
Nextra uses _meta.json files to configure navigation:
- File-based routing: Each
.mdxfile becomes a page - Navigation order: Controlled by
_meta.jsonfiles - Nested sections: Directories with
_meta.jsoncreate navigation groups
Simple page list:
{
"introduction": "Introduction",
"getting-started": "Getting Started",
"advanced": "Advanced Topics"
}External links:
{
"api_ref": {
"title": "API Reference ↗",
"type": "page",
"href": "https://api.artifactsmmo.com/docs",
"newWindow": true
}
}Hidden pages:
{
"index": "Introduction",
"hidden-page": {
"display": "hidden"
}
}You can use React components in your Markdown:
import { Callout } from 'nextra/components'
import { Tabs } from 'nextra/components'
import { Cards, Card } from 'nextra/components'
<Callout type="warning" emoji="⚠️">
Important warning message
</Callout>
<Cards>
<Card title="API Guide" href="/api_guide/authorization" />
<Card title="Quickstart" href="/quickstart/introduction" />
</Cards>-
Add images to the
public/directory or reference external URLs:
-
Use Next.js Image component for optimized loading:
import Image from 'next/image' <Image src="/my-image.png" alt="Description" width={500} height={300} />
The site appearance is configured in theme.config.tsx:
const config: DocsThemeConfig = {
logo: <span><img src="logo-url" alt="logo" /></span>,
chat: {
link: 'https://discord.gg/invite-code',
},
docsRepositoryBase: 'https://github.com/user/repo/blob/main/',
footer: {
text: '© 2025 Your Company',
},
primaryHue: 164, // Brand color hue
primarySaturation: 55, // Brand color saturation
// ... other options
}- Logo: Update the
logoproperty - Colors: Adjust
primaryHueandprimarySaturation - Footer: Modify the
footer.text - Social links: Update
chat.linkfor Discord, add GitHub link - Edit links: Configure
docsRepositoryBasefor "Edit this page" links
This site is typically deployed on platforms like:
- Vercel (recommended for Next.js apps)
- Netlify
- GitHub Pages (with static export)
npm run buildThis creates an optimized build in the .next directory.
Port already in use:
# Kill process on port 3000
lsof -ti:3000 | xargs kill -9
# Or use a different port
npm run dev -- -p 3001Build errors:
- Check for syntax errors in
.mdxfiles - Ensure all
_meta.jsonfiles have valid JSON - Verify all imported components exist
Navigation not updating:
- Check
_meta.jsonsyntax - Restart the development server
- Clear Next.js cache:
rm -rf .next
Images not loading:
- Verify image paths are correct
- Check if images exist in
public/directory - For external images, ensure URLs are accessible
Components not rendering:
- Verify import statements
- Check component syntax
- Ensure components are available in Nextra
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-improvement - Make your changes following the guidelines above
- Test locally:
npm run devand verify your changes - Build successfully:
npm run build - Submit a pull request
For questions or issues:
- Join our Discord community
- Create an issue in this repository
- Check existing documentation and examples