GD Resources logo

Contributing Guidelines #

OmgRod avatar
Written by:
OmgRod
Owner

Before you contribute to GD Resources, there are a few things you should know:

How to setup GD Resources? #

Prerequisites #

  • Node.js ≥20.9.0
  • Git
  • A computer running Windows, macOS, or Linux (you can use Termux if on Android - but it's annoying)

Initial setup #

  1. 1

    Clone the repository:

    bash
    1git clone https://github.com/OmgRod/gd-resources
  2. 2

    Navigate to the new folder:

    bash
    1cd gd-resources
  3. 3

    Install all packages:

    bash
    1npm install
  4. 4

    Start the server

    bash
    1npm run dev

How do components work here? #

GD Resources is based on a docs template made by OmgRod called MiniWiki. To find out how components work and how to use them, read here.

We now have components docs which you may read here!

However, GD Resources also has a few new components that aren't present in MiniWiki, which will be listed below:

How to give yourself credit? #

  1. 1

    We use GitHub to host this website's code, so you should create an account if you haven't yet.

  2. 2

    Add yourself as an author in content/authors.json, like this:

    json
    1{
    2 "YourUsername": {
    3 "name": "YourUsername",
    4 "avatar": "YourAvatarUrl", // you can upload your own avatar to `public/assets/avatars`
    5 "url": "YourPortfolioOrProfile.com"
    6 }
    7}
  3. 3

    If you are creating a new category/subcategory, ensure it contains at least the following files:

    1. index.mdx
    2. guides/index.mdx

Category file templates #

index.mdx #

mdx
1---
2title: [CATEGORY NAME] - Table of Contents
3description: [CATEGORY NAME] tutorials
4editPage: true
5---
6
7# [CATEGORY NAME]: Table of Contents
8
9<Link href="/[CATEGORY PATH]/guides/index">View official guides here</Link>
10
11## Useful Resources
12
13<Table>
14 <THead>
15 <TR>
16 <TH>Resource</TH>
17 <TH>Developer</TH>
18 <TH>Description</TH>
19 </TR>
20 </THead>
21 <TBody>
22 <TR>
23 <TH><Link href="[RESOURCE URL]">[RESOURCE NAME]</Link></TH>
24 <TH><Link href="[DEVELOPER GITHUB/PORTFOLIO]">[DEVELOPER NAME]</Link></TH>
25 <TH>[DESCRIPTION]</TH>
26 </TR>
27 </TBody>
28</Table>

You may add more rows by cloning the <TR> tag and pasting it below the closing </TR> tag.

guides/index.mdx #

mdx
1---
2title: [CATEGORY NAME] - Guides
3description: [CATEGORY NAME] official guides
4editPage: true
5---
6
7# [CATEGORY NAME]: Guides
8
9## Sub-categories
10
11<GuidesTable subdirectory="[CATEGORY PATH]/guides/[SUBCATEGORY PATH]" caption="[SUBCATEGORY NAME]" />
12
13## Individual Guides
14
15<GuidesTable guides={guides} />

Sub-categories are optional. If no sub-categories are present, remove the two subtitles and the GuidesTable in between.

Creating Guides #

You can create a guide using the following template:

mdx
1---
2title: [GUIDE TITLE]
3description: [GUIDE DESCRIPTION]
4author: [YOUR USERNAME]
5editPage: true
6order: ORDER_NUMBER
7navigation: true
8---
9
10# [GUIDE TITLE]
11
12ADD YOUR STUFF HERE

It is important that:

  1. The guide title is the exact same in both fields.
  2. You keep the description relatively short (1-2 sentences max). But keep it descriptive enough as this will appear in category/guides/index.mdx.
  3. Your username is the exact same as the one you put in authors.json.
  4. editPage is ALWAYS TRUE!
  5. ORDER_NUMBER must be a number. The higher the number, the further down it appears. It is completely optional and only recommended for subcategory guides.
  6. navigation must ALWAYS be true, to enable page navigation at the bottom of the guide page.

Also, whenever you create a guide, you must add it to sidebar.json, like this:

json
1{
2 "title": "CATEGORY TITLE",
3 "collapsible": true,
4 "items": [
5 { "title": "Table of Contents", "path": "/CATEGORY PATH/index" },
6 { "title": "Official Guides", "path": "/CATEGORY PATH/guides/index" },
7 { "title": "SUBCATEGORY/SERIES NAME", "collapsible": true, "items": [
8 { "title": "1: PART 1 TITLE", "path": "/CATEGORY PATH/guides/SUBCATEGORY PATH/chap1" }
9 ]},
10 { "title": "YOUR GUIDE NAME (IF IN SAME CATEGORY)", "path": "/CATEGORY PATH/guides/index" },
11 ]
12},

In the JSON code above, there is an example for regular guides, and an example for subcategories (or a series of tutorials). Below are the rules for either of the guides:

  1. Always place new guides after the two default entries:
  • Table of Contents
  • Official Guides
  1. Each guide must have a unique, readable title (avoid generic names like “Guide 1”).
  2. Keep paths consistent with folder structure:
  • /CATEGORY PATH/guides/guide-name
  1. Do not create unnecessary nesting if the guide is standalone.
  2. Use lowercase, hyphen-separated file paths for consistency.
  3. navigation must ALWAYS be true, to enable page navigation at the bottom of the guide page.

Pushing your changes to GitHub #

Now that you finished writing your guide, you may push your changes to GitHub:

  1. 1

    Commit your changes and push them once you're done:

    bash
    1git commit -m "what did you change?"
    2git push

    VS Code is highly recommended for Git operations if you're new to Git.

  2. 2

    Once your changes have been pushed on GitHub, open the repository (should be in your account). Click the button that says "Contribute" and when opened, click "Open pull request". You should see something like shown below (this is on a different repository so this will look slightly different for you):

    A popup that shows up when clicking the 'contribute' buttonThe pull request creation screen

If you need any help, feel free to ask a question on GitHub or contact OmgRod in any of the links in the footer below!