Configuración del bot
Puede configurar El bot all-contribuitors actualizando el archivo JSON .all-contributorsrc
Archivo JSON. 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.
Usted está viendo la bot configuración 🤖, que es similar a la de configuración CLI
Estas son las claves que puede especificar:
Opción | Descrición | Ejemplo/Defecto |
---|---|---|
projectName | Obligatorio, nombre del proyecto. | Ejemplo: all-contributors-cli |
projectOwner | Obligatorio, nombre del usuario que aloja el proyecto. | Example: tenshiAMD |
repoType | Tipo de repositorio. Debe ser github o gitlab . | Defecto: 100 |
repoHost | Apunta al nombre de host del repositorio. Cámbiala si usas un repositorio auto alojado. | Defecto: https://github.com si repoType es github , y https://gitlab.com si repoType es gitlab |
files | Arreglo (o vector) de archivos para actualizar. | Defecto: ['README.md'] |
imageSize | Tamaño (en px) del avatar del usuario. | Defecto: 100 |
commit | Insignia de auto-commit al agregar colaboradores. | Por defecto: false |
commitConvention | Commit convention (angular , atom , ember , eslint , jshint , gitmoji , or none ). | Default: angular |
contributorsPerLine | Número máximo de columnas para la tabla de colaboradores. | Defecto: 7 |
contributorsSortAlphabetically | true : Ordena alfabéticamente. false : Mostar por orden de contribución. | Por defecto: false |
badgeTemplate | Defina su propia plantilla de lodash para generar la insignia. | |
contributorTemplate | Defina su propia plantilla de lodash para generar el colaborador. | |
wrapperTemplate | Define your own lodash template to wrap the list of contributors | |
types | Especifique símbolos personalizados o plantillas de enlaces para los tipos de contribución. Puede anular los tipos documentados. | |
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 | Lista de los colaboradores de este proyecto, este se actualiza por @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": []
}
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.
Add your first contributor. See the Bot Usage page for instructions.
Create the
CONTRIBUTORS.md
file.Copy the code which can be found in this guide.
Modify the
files
key in the.all-contributorsrc
JSON file to match your new file name.{ "files": [ "CONTRIBUTORS.md" ], ... }
Now you should be good to go. New contributors will be added to this new file instead of the
README.md
file.