Skip to content
Merged
43 changes: 43 additions & 0 deletions .github/instructions/git.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# GitHub Copilot Instructions

## Git Commit Guidelines

### Commit Message Format

- Use imperative mood in commit messages (e.g., "Add feature" not "Added feature")
- Start with a verb: Add, Update, Fix, Remove, Refactor, etc.
- Keep the summary line under 50 characters
- Use present tense

### Commit Message Structure

```plaintext
<type>: <short summary>

<detailed description (optional)>
```

### Types

- `feat`: New feature or content
- `fix`: Bug fix or correction
- `docs`: Documentation changes
- `style`: Formatting, CSS changes (no code change)
- `refactor`: Code refactoring
- `chore`: Maintenance tasks

### Examples

Good commit messages:

- `feat: Add atomic habits book review post`
- `fix: Correct typo in classification metrics post`
- `style: Update post layout spacing`
- `docs: Update README with setup instructions`

### Description Guidelines

- Explain WHAT changed and WHY (not HOW)
- Use bullet points for multiple changes
- Reference issue numbers if applicable
- Keep it concise but informative
38 changes: 38 additions & 0 deletions .github/instructions/markdown.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
applyTo: "**/*.md"
---

# Markdown Files Instructions

## Post Files

- All blog posts must be placed in `_posts/` directory
- Use filename format: `YYYY-MM-DD-title.md` (e.g., `2025-12-13-my-post.md`)
- Always include YAML front matter at the top of each post

## YAML Front Matter

Required fields:

- `layout: post`
- `title: "Your Post Title"`

Optional but recommended:

- `subtitle: "A brief description"`
- `tags: [tag1, tag2, tag3]`
- `comments: true/false`

## Content Structure

- Use clear heading hierarchy (h2, h3, h4)
- Add blank lines between sections for readability
- Use code blocks with language specification (e.g., ```python,```javascript)
- Include alt text for all images

## Writing Style

- Write content in English
- Keep paragraphs concise and focused
- Use lists for better readability
- Add relevant tags for post categorization
24 changes: 24 additions & 0 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Markdown Lint

on:
pull_request:
paths:
- "**.md"
workflow_dispatch:

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Markdown Lint
uses: DavidAnson/markdownlint-cli2-action@v16
with:
globs: |
**/*.md
!node_modules
19 changes: 19 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"default": true,
"MD003": {
"style": "atx"
},
"MD007": {
"indent": 2
},
"MD013": {
"line_length": 1000,
"code_blocks": false,
"tables": false
},
"MD024": {
"siblings_only": true
},
"MD033": false,
"MD041": false
}
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
repos:
- repo: local
hooks:
- id: lint-markdown
name: Lint Markdown files
entry: npx --yes markdownlint-cli2
language: system
files: \.md$
pass_filenames: true
57 changes: 56 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Visit the live site at: [https://mazino2d.github.io](https://mazino2d.github.io)
- Bundler
- Jekyll

### Setup
### Compilation Setup

1. Clone the repository:

Expand Down Expand Up @@ -70,6 +70,61 @@ Visit the live site at: [https://mazino2d.github.io](https://mazino2d.github.io)

The site will automatically rebuild when you make changes to the source files.

## Pre-commit Setup (Optional)

This project uses pre-commit hooks to automatically lint Markdown files before each commit.

### Installing Pre-commit

1. Install pre-commit:

```bash
# macOS
brew install pre-commit

# or using pip
pip install pre-commit
```

2. Install the git hook scripts:

```bash
pre-commit install
```

### Running Pre-commit Manually

To run pre-commit hooks on all files manually:

```bash
pre-commit run --all-files
```

To run pre-commit on specific files:

```bash
pre-commit run --files path/to/file.md
```

### Pre-commit Configuration

The project uses `markdownlint-cli2` to check Markdown files. The configuration is in `.pre-commit-config.yaml`.

### Troubleshooting

If pre-commit fails:

1. Review the error messages
2. Fix the issues in your Markdown files
3. Stage the fixes: `git add .`
4. Try committing again

To skip pre-commit hooks (not recommended):

```bash
git commit --no-verify
```

## Project Structure

```plaintext
Expand Down
Loading