|
| 1 | +# Contributing to Golang Mastery |
| 2 | + |
| 3 | +Thank you for your interest in contributing to Golang Mastery! This document provides guidelines and instructions for contributing to our project. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Code of Conduct](#code-of-conduct) |
| 8 | +- [How Can I Contribute?](#how-can-i-contribute) |
| 9 | +- [Setting Up the Development Environment](#setting-up-the-development-environment) |
| 10 | +- [Content Guidelines](#content-guidelines) |
| 11 | + - [Creating a New Lab](#creating-a-new-lab) |
| 12 | + - [Creating a New Project](#creating-a-new-project) |
| 13 | + - [Using MDX Components](#using-mdx-components) |
| 14 | +- [Pull Request Process](#pull-request-process) |
| 15 | +- [Style Guide](#style-guide) |
| 16 | + |
| 17 | +## Code of Conduct |
| 18 | + |
| 19 | +This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [maintainers@golangmastery.com](mailto:maintainers@golangmastery.com). |
| 20 | + |
| 21 | +## How Can I Contribute? |
| 22 | + |
| 23 | +There are many ways to contribute to Golang Mastery: |
| 24 | + |
| 25 | +1. **Content Creation**: Create new labs, projects, or courses |
| 26 | +2. **Content Improvement**: Enhance existing content with better explanations, examples, or exercises |
| 27 | +3. **Bug Fixes**: Fix issues with the website or content |
| 28 | +4. **Feature Development**: Add new features to the website |
| 29 | +5. **Documentation**: Improve documentation for contributors or users |
| 30 | + |
| 31 | +## Setting Up the Development Environment |
| 32 | + |
| 33 | +1. Fork the repository |
| 34 | +2. Clone your fork: |
| 35 | + ```bash |
| 36 | + git clone https://github.com/your-username/golangmastery.githhub.io.git |
| 37 | + cd golangmastery.githhub.io |
| 38 | + ``` |
| 39 | +3. Install dependencies: |
| 40 | + ```bash |
| 41 | + npm install |
| 42 | + ``` |
| 43 | +4. Start the development server: |
| 44 | + ```bash |
| 45 | + npm run dev |
| 46 | + ``` |
| 47 | +5. Open [http://localhost:3000](http://localhost:3000) in your browser |
| 48 | + |
| 49 | +## Content Guidelines |
| 50 | + |
| 51 | +### Creating a New Lab |
| 52 | + |
| 53 | +1. Use the lab template in `content/templates/lab-template.mdx` as a starting point |
| 54 | +2. Save your lab in the `content/labs` directory with a descriptive slug (e.g., `your-first-go-program.mdx`) |
| 55 | +3. Fill in the frontmatter with appropriate metadata: |
| 56 | + ```yaml |
| 57 | + --- |
| 58 | + title: 'Lab Title Here' |
| 59 | + slug: 'lab-slug-here' |
| 60 | + description: 'A brief description of the lab (1-2 sentences)' |
| 61 | + duration: '30 minutes' # Estimated time to complete |
| 62 | + level: 'Beginner' # Beginner, Intermediate, or Advanced |
| 63 | + tags: ['Go', 'Tag2', 'Tag3'] |
| 64 | + prerequisites: ['prerequisite-lab-slug'] # Slugs of prerequisite labs |
| 65 | + --- |
| 66 | + ``` |
| 67 | +4. Structure your lab with clear sections: |
| 68 | + - Introduction |
| 69 | + - Learning Objectives |
| 70 | + - Prerequisites |
| 71 | + - Step-by-step instructions |
| 72 | + - Explanations |
| 73 | + - Exercises |
| 74 | + - Summary |
| 75 | + |
| 76 | +### Creating a New Project |
| 77 | + |
| 78 | +1. Use the project template in `content/templates/project-template.mdx` as a starting point |
| 79 | +2. Save your project in the `content/projects` directory with a descriptive slug (e.g., `build-a-cli-task-manager.mdx`) |
| 80 | +3. Fill in the frontmatter with appropriate metadata: |
| 81 | + ```yaml |
| 82 | + --- |
| 83 | + title: 'Project Title Here' |
| 84 | + slug: 'project-slug-here' |
| 85 | + coverImage: '/images/projects/project-image.png' |
| 86 | + description: 'A brief description of the project (1-2 sentences)' |
| 87 | + duration: '2-3 hours' # Estimated time to complete |
| 88 | + level: 'Intermediate' # Beginner, Intermediate, or Advanced |
| 89 | + tags: ['Go', 'Tag2', 'Tag3'] |
| 90 | + prerequisites: ['prerequisite-lab-slug'] # Slugs of prerequisite labs |
| 91 | + githubRepo: 'username/repo-name' # Optional GitHub repository |
| 92 | + --- |
| 93 | + ``` |
| 94 | +4. Structure your project with clear sections: |
| 95 | + - Project Overview |
| 96 | + - Learning Objectives |
| 97 | + - Prerequisites |
| 98 | + - Implementation steps |
| 99 | + - Testing |
| 100 | + - Challenges |
| 101 | + - Summary |
| 102 | + |
| 103 | +### Using MDX Components |
| 104 | + |
| 105 | +We provide several custom MDX components to enhance your content: |
| 106 | + |
| 107 | +#### Code Block |
| 108 | + |
| 109 | +````markdown |
| 110 | +```go |
| 111 | +package main |
| 112 | + |
| 113 | +import "fmt" |
| 114 | + |
| 115 | +func main() { |
| 116 | + fmt.Println("Hello, World!") |
| 117 | +} |
| 118 | +``` |
| 119 | +```` |
| 120 | + |
| 121 | +#### Callout |
| 122 | + |
| 123 | +```jsx |
| 124 | +<Callout type="info" title="Optional Title"> |
| 125 | + This is an informational callout. |
| 126 | +</Callout> |
| 127 | +``` |
| 128 | + |
| 129 | +Types: `info`, `warning`, `error`, `tip` |
| 130 | + |
| 131 | +#### Step |
| 132 | + |
| 133 | +```jsx |
| 134 | +<Step number="1" title="Step Title"> |
| 135 | + Step content goes here. |
| 136 | +</Step> |
| 137 | +``` |
| 138 | + |
| 139 | +#### Terminal |
| 140 | + |
| 141 | +```jsx |
| 142 | +<Terminal> |
| 143 | +npm install |
| 144 | +npm run dev |
| 145 | +</Terminal> |
| 146 | +``` |
| 147 | + |
| 148 | +#### FileTree |
| 149 | + |
| 150 | +```jsx |
| 151 | +<FileTree> |
| 152 | +project/ |
| 153 | +├── main.go |
| 154 | +├── go.mod |
| 155 | +└── go.sum |
| 156 | +</FileTree> |
| 157 | +``` |
| 158 | + |
| 159 | +## Pull Request Process |
| 160 | + |
| 161 | +1. Create a new branch for your changes: |
| 162 | + ```bash |
| 163 | + git checkout -b feature/your-feature-name |
| 164 | + ``` |
| 165 | +2. Make your changes |
| 166 | +3. Test your changes locally |
| 167 | +4. Commit your changes with a descriptive commit message: |
| 168 | + ```bash |
| 169 | + git commit -m "Add new lab: Your First Go Program" |
| 170 | + ``` |
| 171 | +5. Push your changes to your fork: |
| 172 | + ```bash |
| 173 | + git push origin feature/your-feature-name |
| 174 | + ``` |
| 175 | +6. Create a pull request from your fork to the main repository |
| 176 | +7. Wait for review and address any feedback |
| 177 | + |
| 178 | +## Style Guide |
| 179 | + |
| 180 | +### Code Style |
| 181 | + |
| 182 | +- Follow the [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments) for Go code |
| 183 | +- Follow the [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript) for JavaScript/React code |
| 184 | + |
| 185 | +### Content Style |
| 186 | + |
| 187 | +- Use clear, concise language |
| 188 | +- Explain concepts thoroughly but avoid unnecessary verbosity |
| 189 | +- Include practical examples and exercises |
| 190 | +- Use proper formatting for code, commands, and file paths |
| 191 | +- Break down complex topics into manageable steps |
| 192 | +- Include diagrams or images where appropriate |
| 193 | + |
| 194 | +Thank you for contributing to Golang Mastery! |
0 commit comments