Skip to content

Commit bee0da1

Browse files
committed
add
1 parent 33e27a8 commit bee0da1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+13768
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to GitHub Pages
3+
4+
on:
5+
# Trigger workflow on push to the main branch
6+
push:
7+
branches:
8+
- main
9+
10+
# Allow manual trigger of the workflow through the Actions tab
11+
workflow_dispatch:
12+
13+
permissions:
14+
# Set required permissions for deployment
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
concurrency:
20+
# Allow only one deployment at a time, cancel in-progress deployments
21+
group: 'github-pages-deployment'
22+
cancel-in-progress: true
23+
24+
jobs:
25+
deploy:
26+
# Define the target deployment environment
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
# Step 1: Check out the repository
34+
- name: Check out the code
35+
uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 1
38+
39+
# Step 2: Set up Node.js environment
40+
- name: Set up Node.js
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 20
44+
cache: npm
45+
46+
# Step 3: Install dependencies
47+
- name: Install project dependencies
48+
run: npm ci
49+
50+
# Step 4: Build the project
51+
- name: Build the project
52+
run: npm run build
53+
54+
# Step 5: Configure GitHub Pages
55+
- name: Configure GitHub Pages
56+
uses: actions/configure-pages@v4
57+
58+
# Step 6: Upload build artifacts
59+
- name: Upload build artifacts
60+
uses: actions/upload-pages-artifact@v3
61+
with:
62+
path: ./dist
63+
64+
# Step 7: Deploy to GitHub Pages
65+
- name: Deploy to GitHub Pages
66+
id: deployment
67+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
# Dependencies
2+
node_modules
3+
/.pnp
4+
.pnp.js
5+
.yarn/install-state.gz
6+
7+
# Testing
8+
/coverage
9+
10+
# Next.js
11+
/.next/
12+
/out/
13+
14+
# Production
15+
/build
16+
17+
# Misc
18+
.DS_Store
19+
*.pem
20+
21+
# Debug
22+
npm-debug.log*
23+
yarn-debug.log*
24+
yarn-error.log*
25+
26+
# Local env files
27+
.env*.local
28+
.env
29+
30+
# Vercel
31+
.vercel
32+
33+
# TypeScript
34+
*.tsbuildinfo
35+
next-env.d.ts
36+
137
# If you prefer the allow list template instead of the deny list, see community template:
238
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
339
#
@@ -20,6 +56,3 @@
2056
# Go workspace file
2157
go.work
2258
go.work.sum
23-
24-
# env file
25-
.env

CONTRIBUTING.md

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
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

Comments
 (0)