This repository contains markdown files for tutorials displayed on my page.
tutorials/
├── basics/
│ ├── start.md
│ └── setup.md
├── advanced/
│ └── optimize.md
└── ...
scripts/
├── generate.js
└── validate.js
meta.json # Generated metadata about all tutorials
The location of your markdown file in the directory structure determines its slug. For example:
- File path:
tutorials/basics/start.md- Corresponding slug:
basics-start
- Corresponding slug:
- File path:
tutorials/advanced/optimize.md- Corresponding slug:
advanced-optimize
- Corresponding slug:
Each tutorial must begin with YAML frontmatter containing the following fields:
---
title: "Your Tutorial Title"
description: "A brief description of the tutorial (1-2 sentences)"
tags: ["tag1", "tag2"]
date: "YYYY-MM-DD"
author: "Your Name"
slug: "category-name" # Must match the file path format
---title: Clear and concise titledescription: 1-2 sentence summarytags: Array of relevant keywordsdate: ISO format (YYYY-MM-DD)author: Your full nameslug: Must match the file path with categories separated by hyphens
- Choose the appropriate category directory under
tutorials/or create a new one - Create your markdown file with a simple verb as the name
- Ensure the slug matches the file path format
- Write your content using markdown
- Run validation before submitting:
npm run validate
# Validate all tutorials
npm run validate
# Generate meta.json
npm run generate- Use proper markdown syntax
- Include code examples where relevant
- Add images in the appropriate directory
- Keep the frontmatter complete and accurate
- Use simple verbs for filenames
- Avoid hyphens in directory and file names
The validation script checks:
- Presence of all required frontmatter fields
- Date format validity
- Slug format and correspondence with file path
- Tags array validity
- Fork the repository
- Create your feature branch
- Make your changes
- Run validation
- Submit a pull request