Konfiguracja Bota
Konfigurację bota all-contributors
możesz przeprowadzić poprzez aktualizację pliku JSON .all-contributorsrc
. 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.
Przeglądasz 🤖Konfigurację Bota, która podobna jest do Konfiguracji CLI
Klucze do określenia:
Opcja | Opis | Przykład/Domyślnie |
---|---|---|
projectName | Obowiązkowe, nazwa projektu. | Przykład: all-contributors-cli |
projectOwner | Obowiązkowe, nazwa użytkownika przez którego projekt jest hostowany. | Example: tenshiAMD |
repoType | Typ repozytorium. Musi to być jedno z dwóch: github lub gitlab . | Domyślnie: github |
repoHost | Wskazuje nazwę hosta repozytorium. Zmień jeśli używasz repozytorium hostowanego przez siebie. | Domyślnie: https://github.com jeśli repoType to github oraz https://gitlab.com jeśli repoType to gitlab |
pliki | Tablica plików do aktualizacji. | Domyślnie: ['README.md'] |
rozmiar obrazu | Wymiary avatara użytkownika (w pikselach). | Domyślnie: 100 |
commit | Automatyczne przyznawanie odznaki kontrybutora po ich dodaniu. | Domyślnie: false |
commitConvention | Commit convention (angular , atom , ember , eslint , jshint , gitmoji , or none ). | Default: angular |
contributorsPerLine | Maksymalna liczba kolumn w tabeli kontrybutorów. | Domyślnie: 7 |
contributorsSortAlphabetically | true : Sortuj alfabetycznie. false : Wyświetlaj w kolejności dodania. | Domyślnie: false |
badgeTemplate | Zdefiniuj szablon lodasha do wygenerowania odznaki. | |
contributorTemplate | Zdefiniuj szablon lodasha do wygenerowania kontrybutora. | |
wrapperTemplate | Define your own lodash template to wrap the list of contributors | |
types | Określ niestandardowe symbole lub podlinkuj szablony dla typów kontrybucji. Możesz nadpisać udokumentowane typy. | |
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 Contributors do tego projektu została zaktualizowana poprzez komendę @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.