Back to Main Contribution Guide

Legacy JSON Contribution Method

Learn about the original JSON-based contribution method. New contributors should use the MDX method instead.

⚠️ Legacy Method

This is the original JSON-based contribution method. While it still works, we recommend using the new MDX method for new contributions as it's much simpler and more user-friendly.

Learn the new MDX method instead

How to Add Documentation (JSON Method)

  1. Add a JSON file in src/db/ (your doc's data), e.g., my-doc.json.
  2. Write your content in the JSON file, following the structure of other docs.
  3. Run pnpm run build locally. This will generate the docs index so your new doc is included.
  4. Push your changes to the repository.
  5. Open a Pull Request—that's it! The docs list will update automatically after the build.
src/db/<your-doc>.jsonpnpm run build

JSON Structure

File: <your-doc>.json

Each doc file should include:

  • title: Section or topic title (used for the card and route)
  • description: Short summary for the card
  • filename: The JSON file name in src/db/
  • id: (optional) Internal reference

Example docs-index.json entry:

{
  "title": "Getting Started",
  "description": "Initialize your documentation project with a single command.",
  "filename": "getting-started.json"
}

Legacy Project Structure

├── public
│   └── logoIcon.png
├── README.md
├── src
│   ├── app
│   │   ├── all-docs
│   │   │   ├── layout.tsx
│   │   │   └── page.tsx
│   │   ├── contribution-guide
│   │   │   └── page.tsx
│   │   ├── (main)
│   │   │   └── <kebab-case-title>
│   │   │       └── page.tsx
│   ├── components
│   │   └── documentation
│   │       └── documentation-component.tsx
│   ├── db
│   │   ├── <your-doc>.json
│   │   └── docs-index.json
│   └── lib
│       └── utils.ts

Why We Moved to MDX

JSON Method Challenges

  • Complex JSON structure to learn
  • Need to create both JSON and TSX files
  • Manual navigation management
  • Build step required for each change
  • Harder for non-developers
  • More prone to syntax errors

MDX Method Benefits

  • Simple Markdown syntax
  • Just one file per document
  • Auto-generated navigation
  • No build step needed
  • Accessible to everyone
  • Less error-prone

Migrating from JSON to MDX

If you have existing JSON-based documentation, here's how to migrate to MDX:

  1. Create a new .mdx file in src/docs/ with the same name as your JSON file
  2. Convert your content from JSON structure to Markdown format
  3. Test locally to ensure everything renders correctly
  4. Update any links that point to the old JSON-based route
  5. Remove the old JSON file once the MDX version is working

Tips for JSON Contributors

Thanks for Understanding!

We appreciate all contributors, whether you use the legacy JSON method or the new MDX approach. Every contribution helps make EasyGoDocs better! 🚀