A hands-on Git tutorial where you learn by contributing recipes to a collaborative cookbook. This project teaches Git fundamentals through practical, real-world contributions.
This repository serves as both:
- A learning tool for Git/GitHub fundamentals
- A template repository that anyone can fork to create their own recipe collection
- Fork this repository by clicking the "Fork" button at the top right
- Clone your fork to your local machine:
git clone https://github.com/YOUR-USERNAME/git-recipe-book.git cd git-recipe-book - Install dependencies:
npm install
- Start the development server:
npm run dev
- Add your recipe (see Contributing section below)
- Commit and push your changes
- Create a Pull Request to the original repository
- Click "Use this template" on GitHub to create your own repository
- Clone your new repository
- Update the configuration in
astro.config.mjs:- Change
siteto your GitHub Pages URL - Update
baseto your repository name - Update the GitHub link in the social section
- Change
- Start adding your own recipes!
Recipes are stored as MDX files in category-specific directories:
src/content/docs/
βββ appetizers/
βββ main-courses/
βββ desserts/
βββ index.mdx
Create a new .mdx file in the appropriate category folder:
---
title: Your Recipe Name
description: A brief introduction to your recipe (will appear at the top of your page)
category: dessert # appetizer, first-course, main-course, side-dish, dessert, or beverage
ingredients:
- Ingredient 1 with quantity
- Ingredient 2 with quantity
- Ingredient 3 with quantity
servings: 4
prepTime: 15 minutes
cookTime: 30 minutes
---
import { Steps } from '@astrojs/starlight/components';
## Instructions
<Steps>
1. First step with clear instructions
2. Second step with clear instructions
3. Continue with numbered steps
4. Final step
</Steps>
## Tips
- Add any helpful tips or variations hereThat's it! Copy the import line, add your frontmatter, and write the instructions. The description and ingredients are automatically displayed.
-
Create a branch for your recipe:
git checkout -b add-your-recipe-name
-
Add your recipe file to the appropriate category folder
-
Test locally:
npm run dev
-
Commit your changes:
git add . git commit -m "Add [Recipe Name] to [Category]"
-
Push to your fork:
git push origin add-your-recipe-name
-
Create a Pull Request on GitHub
All commands are run from the root of the project:
| Command | Action |
|---|---|
npm install |
Installs dependencies |
npm run dev |
Starts local dev server at localhost:4321 |
npm run build |
Build your production site to ./dist/ |
npm run preview |
Preview your build locally, before deploying |
npm run astro ... |
Run CLI commands like astro add, astro check |
This project is configured to automatically deploy to GitHub Pages when you push to the main branch.
- Go to your repository Settings
- Navigate to Pages (under "Code and automation")
- Under "Source", select "GitHub Actions"
- Push to the
mainbranch - the site will build and deploy automatically
Before deploying, update astro.config.mjs:
export default defineConfig({
site: 'https://YOUR-USERNAME.github.io',
base: '/YOUR-REPO-NAME',
// ...
});Replace YOUR-USERNAME with your GitHub username and YOUR-REPO-NAME with your repository name.
By contributing to this project, you'll practice:
- β Forking repositories
- β Cloning repositories to your local machine
- β Creating branches for new features
- β Making commits with clear messages
- β Pushing changes to remote repositories
- β Creating pull requests
- β Collaborating through code review
- β Keeping your fork in sync with the original
βββ .github/
β βββ workflows/
β βββ deploy.yml # GitHub Actions deployment
βββ public/ # Static assets
βββ src/
β βββ assets/ # Images and media
β βββ content/
β β βββ config.ts # Content collection schema
β β βββ docs/ # All recipe content
β β βββ appetizers/
β β βββ main-courses/
β β βββ desserts/
β β βββ index.mdx # Home page
β βββ env.d.ts
βββ astro.config.mjs # Astro configuration
βββ package.json
βββ tsconfig.json
- Must include all required frontmatter fields (title, description, category, ingredients)
- Instructions must use the
<Steps>component for proper formatting - Ingredients should be listed with quantities
- Include prep time and cook time when applicable
- Test your recipe page locally before submitting
- One recipe per pull request
- Use descriptive commit messages (e.g., "Add Chocolate Chip Cookies to Desserts")
- Include a brief description in your PR about the recipe
- Make sure the site builds successfully (
npm run build)
This template is perfect for teaching Git in a classroom setting:
- Students fork the repo and work on their own recipes
- Practice creating pull requests in a fun, non-technical context
- Review and merge student contributions
- Students see their contributions go live on the class website
This project is open source and available under the MIT License.
Happy git-cooking! π¨βπ³π©βπ»