Skip to content

Commit fdea806

Browse files
rachelcarmenaBerkmann18
authored andcommitted
fix: badge link change
Fix #195
1 parent 42bc241 commit fdea806

File tree

8 files changed

+21
-11
lines changed

8 files changed

+21
-11
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,15 @@
325325
"contributions": [
326326
"code"
327327
]
328+
},
329+
{
330+
"login": "rachelcarmena",
331+
"name": "Rachel M. Carmena",
332+
"avatar_url": "https://avatars0.githubusercontent.com/u/22792183?v=4",
333+
"profile": "https://rachelcarmena.github.io",
334+
"contributions": [
335+
"code"
336+
]
328337
}
329338
]
330339
}

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
[![Code Coverage](https://img.shields.io/codecov/c/github/all-contributors/all-contributors-cli.svg)](https://codecov.io/github/all-contributors/all-contributors-cli)
4747
[![Version](https://img.shields.io/npm/v/all-contributors-cli.svg)](https://www.npmjs.com/package/all-contributors-cli)
4848
[![Downloads](https://img.shields.io/npm/dm/all-contributors-cli.svg)](http://www.npmtrends.com/all-contributors-cli)
49-
[![All Contributors](https://img.shields.io/badge/all_contributors-33-orange.svg?style=flat-square)](#contributors)
49+
[![All Contributors](https://img.shields.io/badge/all_contributors-34-orange.svg?style=flat-square)](#contributors-)
5050
[![Star on Github](https://img.shields.io/github/stars/all-contributors/all-contributors-cli.svg?style=social)](https://github.com/all-contributors/all-contributors-cli/stargazers)
5151

5252
## The problem
@@ -64,7 +64,7 @@ specification for your GitHub or GitLab repository.
6464

6565
If you're looking to use the cli, head over to [the cli docs on allcontributors.org](https://allcontributors.org/docs/en/cli/overview). The all-contributors website contains all the information required to install, configure and use the all-contributors-cli.
6666

67-
## Contributors
67+
## Contributors
6868

6969
Thanks goes to these wonderful people
7070
([emoji key](https://allcontributors.org/docs/en/emoji-key)):
@@ -117,6 +117,7 @@ Thanks goes to these wonderful people
117117
<td align="center"><a href="https://github.com/nschonni"><img src="https://avatars2.githubusercontent.com/u/1297909?v=4" width="100px;" alt="Nick Schonning"/><br /><sub><b>Nick Schonning</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=nschonni" title="Code">💻</a></td>
118118
<td align="center"><a href="https://cezaraugusto.net/"><img src="https://avatars0.githubusercontent.com/u/4672033?v=4" width="100px;" alt="Cezar Augusto"/><br /><sub><b>Cezar Augusto</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=cezaraugusto" title="Documentation">📖</a></td>
119119
<td align="center"><a href="https://reinhold.is"><img src="https://avatars1.githubusercontent.com/u/5678122?v=4" width="100px;" alt="Jeppe Reinhold"/><br /><sub><b>Jeppe Reinhold</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=JReinhold" title="Code">💻</a></td>
120+
<td align="center"><a href="https://rachelcarmena.github.io"><img src="https://avatars0.githubusercontent.com/u/22792183?v=4" width="100px;" alt="Rachel M. Carmena"/><br /><sub><b>Rachel M. Carmena</b></sub></a><br /><a href="https://github.com/all-contributors/all-contributors-cli/commits?author=rachelcarmena" title="Code">💻</a></td>
120121
</tr>
121122
</table>
122123

src/generate/__tests__/format-badge.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import formatBadge from '../format-badge'
44
test('return badge with the number of contributors', () => {
55
const options = {}
66
const expected8 =
7-
'[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors)'
7+
'[![All Contributors](https://img.shields.io/badge/all_contributors-8-orange.svg?style=flat-square)](#contributors-)'
88
const expected16 =
9-
'[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors)'
9+
'[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-)'
1010

1111
expect(formatBadge(options, _.times(_.constant({}), 8))).toBe(expected8)
1212
expect(formatBadge(options, _.times(_.constant({}), 16))).toBe(expected16)

src/generate/__tests__/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ test('replace all-contributors badge if present', () => {
143143
'Badges',
144144
[
145145
'[![version](https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square)](http://npm.im/all-contributors-cli)',
146-
'[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors)',
146+
'[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)',
147147
'[![version](https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square)](http://npm.im/all-contributors-cli)',
148148
].join(''),
149149
'',
@@ -155,7 +155,7 @@ test('replace all-contributors badge if present', () => {
155155
'Badges',
156156
[
157157
'[![version](https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square)](http://npm.im/all-contributors-cli)',
158-
'[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)',
158+
'[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)',
159159
'[![version](https://img.shields.io/npm/v/all-contributors-cli.svg?style=flat-square)](http://npm.im/all-contributors-cli)',
160160
].join(''),
161161
'',

src/generate/format-badge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const _ = require('lodash/fp')
22

33
const defaultTemplate =
4-
'[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg?style=flat-square)](#contributors)'
4+
'[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg?style=flat-square)](#contributors-)'
55

66
module.exports = function formatBadge(options, contributors) {
77
return _.template(options.badgeTemplate || defaultTemplate)({

src/generate/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const _ = require('lodash/fp')
22
const formatBadge = require('./format-badge')
33
const formatContributor = require('./format-contributor')
44

5-
const badgeRegex = /\[!\[All Contributors\]\([a-zA-Z0-9\-./_:?=]+\)\]\(#\w+\)/
5+
const badgeRegex = /\[!\[All Contributors\]\([a-zA-Z0-9\-./_:?=]+\)\]\(#[\w-]+\)/
66

77
function injectListBetweenTags(newContent) {
88
return function(previousContent) {

src/init/__tests__/add-badge.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test('insert badge under title', () => {
44
const content = ['# project', '', 'Description', '', 'Foo bar'].join('\n')
55
const expected = [
66
'# project',
7-
'[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors)',
7+
'[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)',
88
'',
99
'Description',
1010
'',
@@ -20,7 +20,7 @@ test('add badge if content is empty', () => {
2020
const content = ''
2121
const expected = [
2222
'',
23-
'[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors)',
23+
'[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)',
2424
].join('\n')
2525

2626
const result = addBadge(content)

src/init/init-content.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const _ = require('lodash/fp')
22
const injectContentBetween = require('../util').markdown.injectContentBetween
33

44
const badgeContent =
5-
'[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors)'
5+
'[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-)'
66
const headerContent =
77
'Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):'
88
const listContent = [

0 commit comments

Comments
 (0)