From 0bf5d3a49b48bc6df22abb4dd2c81d60c95c508d Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Wed, 18 Mar 2026 17:22:19 +0800 Subject: [PATCH] docs(CONTRIBUTING): update commit message guidelines and examples --- CONTRIBUTING.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1d9f1a32..42d909db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,3 +119,45 @@ Finally, create a new pull request at [!NOTE] +> +> Commits in a PR will normally be squashed into one commit, so you don't need to rebase locally. + +### Commit Message Format + +``` +(): +^ ^ ^ +| | |__ Subject: Concise description of the change (imperative mood, lowercase). +| |____________ Scope: The specific part of the codebase affected (optional but recommended). +|___________________ Type: Indicates the kind of change. +``` + +### Allowed Types + +- `feat`: A new feature. +- `fix`: A bug fix. +- `refactor`: Code changes that neither fix a bug nor add a feature. +- `chore`: Changes to the build process, auxiliary tools, libraries, documentation generation etc. +- `docs`: Documentation only changes. +- Other conventional types like `perf`, `style`, `test`, `ci`, `build` are also acceptable. + +### Allowed Scopes + +- `workflow`: CI/CD workflow changes (`.github/workflows/`) +- `archetypes`: Content templates (`archetypes/`) +- `assets`: Changes to theme assets like CSS, JS (`assets/`) +- `i18n`: Internationalization and translation files (`i18n/`) +- `layouts`: Root-level Hugo template files (`layouts/*.html`) +- `config`: Theme configuration (`hugo.toml`, `theme.toml`) +- _(All top-level directories in the layouts and packages directories)_ +- _(Consider adding other scopes as needed for better granularity)_ + +### Examples + +- `feat(_shortcodes): add mapbox zoom control options` +- `fix(_partials): avoid duplicate canonical link tags` +- `docs(i18n): update translation key naming guidelines` +- `ci(workflow): optimize preview deployment cache` +- `refactor(assets): split theme initialization into smaller modules`