Конфигурация бота
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 | Автоматически коммитить значек (badge) при добавлении участников. | Default: false |
commitConvention | Commit convention (angular, atom, or none). | Default: angular |
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 | Заставляет CI игнорировать коммит. (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, "contributors": []}Перемещение таблицы All Contributors в другой файл
Заголовок раздела «Перемещение таблицы All Contributors в другой файл»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. Вместо этого можно использовать для этого другой файл.
Ниже приведены шаги, которые могут помочь вам в достижении этого. For the sake of this tutorial, the different file that we’ll use is going to be named CONTRIBUTORS.md.
-
Установите бот. See the Installation page for instructions.
-
Добавьте своего первого участника. 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"],...} -
Теперь можно приступать к работе. New contributors will be added to this new file instead of the
README.mdfile.
