Bot配置
You can configure the all-contributors bot behaviour by updating the .all-contributorsrc JSON file.
The data used to generate the contributors list will be stored there, and you
can configure how you want @all-contributors to generate the list.
You are viewing the 🤖Bot Configuration, which is similar to the CLI Configuration
这些是你可以指定的键:
| 选项 | 描述 | 范例/默认 |
|---|---|---|
projectName |
必要,项目名称 | Example: all-contributors-cli |
projectOwner |
必要,项目的持有用户名称 | Example: tenshiAMD |
repoType |
仓库类型, Must be either github or gitlab. |
Default: github |
repoHost |
指向仓库的主机名,如果你用自己托管的仓库请更改 | Default: https://github.com if repoType is github, and https://gitlab.com if repoType is gitlab |
files |
要更新文件的数组 | Default: ['README.md'] |
imageSize |
用户头像尺寸 (以像素为单位) | Default: 100 |
commit |
当添加贡献者时,自动提交徽章 | Default: false |
commentConvention |
Commit convention (angular, atom, or none). |
Default: angular |
commitType |
Set the type for the commit in your chosen commitConvention (read more at Conventional Commits specification. |
Default: docs |
contributorsPerLine |
贡献者表的最大列数 | Default: 7 |
contributorsSortAlphabetically |
true: Sort alphabetically. false: Display in order of addition. |
Default: false |
badgeTemplate |
定义你自己的lodash模版来生成徽章 | |
contributorTemplate |
定义你自己的lodash模版来生成贡献者 | |
wrapperTemplate |
定义你自己的lodash模版来生成贡献者 | |
types |
对于贡献者类型,具体说明自定义符号或者链接模版可以覆盖记录的类型 | |
linkToUsage |
Adds a footer with link to usage (either true or false) |
Default: true |
skipCi |
Makes the CI ignore the commit. (either true or false) |
Default: true |
contributors |
List of contributors for this project, this is updated by @all-contributors add |
{ "projectName": "all-contributors", "projectOwner": "all-contributors", "repoType": "github", "repoHost": "https://github.com", "files": ["README.md"], "imageSize": 100, "commit": false, "contributorsPerLine": 7, "contributorsSortAlphabetically": false, "badgeTemplate": "[](#contributors)", "contributorTemplate": "<a href=\"<%= contributor.profile %>\"><img src=\"<%= contributor.avatar_url %>\" width=\"<%= options.imageSize %>px;\" alt=\"\"/><br /><sub><b><%= contributor.name %></b></sub></a>", "wrapperTemplate": "\n<table>\n <tbody><%= bodyContent %> </tbody>\n<%= tableFooterContent %></table>\n\n", "types": { "custom": { "symbol": "🔭", "description": "A custom contribution type.", "link": "[<%= symbol %>](<%= url %> \"<%= description %>\")," } }, "linkToUsage": true, "skipCi": true, "commitType": "docs", "contributors": []}Moving the All Contributors table into a different file
Section titled “Moving the All Contributors table into a different file”As you know, the default file for the contributors table is README.md. But if your project has tons of contributors, it doesn’t make sense to include the All Contributors table in the README.md file. Instead, you can use a different file to do so.
Here are the steps that may help you in achieving that. For the sake of this tutorial, the different file that we’ll use is going to be named CONTRIBUTORS.md.
-
Install the bot. See the Installation page for instructions.
-
添加你自己为 Contributor. See the Bot Usage page for instructions.
-
Create the
CONTRIBUTORS.mdfile. -
Copy the code which can be found in this guide.
-
Modify the
fileskey in the.all-contributorsrcJSON file to match your new file name..all-contributorsrc {"files": ["CONTRIBUTORS.md"],...} -
Now you should be good to go. New contributors will be added to this new file instead of the
README.mdfile.
