Skip to content

Commit

Permalink
✨ Ask for Patreon username (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
apatrascu authored and kefranabg committed Jun 19, 2019
1 parent af10690 commit 59b57af
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
"contributions": [
"doc"
]
},
{
"login": "apatrascu",
"name": "Alecsandru Patrascu",
"avatar_url": "https://avatars3.githubusercontent.com/u/1193770?v=4",
"profile": "https://github.com/apatrascu",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Feel free to check [issues page](https://github.com/kefranabg/readme-md-generato
<td align="center"><a href="https://nikx.io"><img src="https://avatars2.githubusercontent.com/u/3141005?v=4" width="75px;" alt="Nik"/><br /><sub><b>Nik</b></sub></a><br /><a href="https://github.com/kefranabg/readme-md-generator/commits?author=NikxDa" title="Code">💻</a> <a href="https://github.com/kefranabg/readme-md-generator/commits?author=NikxDa" title="Documentation">📖</a> <a href="https://github.com/kefranabg/readme-md-generator/commits?author=NikxDa" title="Tests">⚠️</a></td>
<td align="center"><a href="https://github.com/ssoobratty"><img src="https://avatars3.githubusercontent.com/u/7631054?v=4" width="75px;" alt="Saffaanh Soobratty"/><br /><sub><b>Saffaanh Soobratty</b></sub></a><br /><a href="https://github.com/kefranabg/readme-md-generator/commits?author=ssoobratty" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/samit4me"><img src="https://avatars3.githubusercontent.com/u/3248531?v=4" width="75px;" alt="Samuel Sharpe"/><br /><sub><b>Samuel Sharpe</b></sub></a><br /><a href="https://github.com/kefranabg/readme-md-generator/commits?author=samit4me" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/apatrascu"><img src="https://avatars3.githubusercontent.com/u/1193770?v=4" width="75px;" alt="Alecsandru Patrascu"/><br /><sub><b>Alecsandru Patrascu</b></sub></a><br /><a href="https://github.com/kefranabg/readme-md-generator/commits?author=apatrascu" title="Code">💻</a></td>
</tr>
</table>

Expand All @@ -104,6 +105,10 @@ Feel free to check [issues page](https://github.com/kefranabg/readme-md-generato

Please ⭐️ this repository if this project helped you!

<a href="https://www.patreon.com/FranckAbgrall">
<img src="https://c5.patreon.com/external/logo/[email protected]" width="160">
</a>

## 📝 License

Copyright © 2019 [Franck Abgrall](https://github.com/kefranabg).<br />
Expand Down
4 changes: 4 additions & 0 deletions src/__snapshots__/readme.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ Contributions, issues and feature requests are welcome!<br />Feel free to check
Give a ⭐️ if this project helped you!
<a href=\\"https://www.patreon.com/FranckAbgrall\\">
<img src=\\"https://c5.patreon.com/external/logo/[email protected]\\" width=\\"160\\">
</a>
## 📝 License
Copyright © 2019 [Franck Abgrall](https://github.com/kefranabg).<br />
Expand Down
5 changes: 5 additions & 0 deletions src/questions/author-patreon.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = () => ({
type: 'input',
message: '❤️ Patreon username (use empty value to skip)',
name: 'authorPatreonUsername'
})
13 changes: 13 additions & 0 deletions src/questions/author-patreon.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const askPatreonUsername = require('./author-patreon')

describe('askPatreonUsername', () => {
it('should return correct question format', () => {
const result = askPatreonUsername()

expect(result).toEqual({
type: 'input',
message: '❤️ Patreon username (use empty value to skip)',
name: 'authorPatreonUsername'
})
})
})
1 change: 1 addition & 0 deletions src/questions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
askAuhtorName: require('./author-name'),
askAuthorGithub: require('./author-github'),
askAuthorTwitter: require('./author-twitter'),
askAuthorPatreon: require('./author-patreon'),
askProjectPrerequisites: require('./project-prerequisites'),
askLicenseName: require('./license-name'),
askLicenseUrl: require('./license-url'),
Expand Down
1 change: 1 addition & 0 deletions src/questions/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ describe('questions', () => {
'askAuhtorName',
'askAuthorGithub',
'askAuthorTwitter',
'askAuthorPatreon',
'askProjectPrerequisites',
'askLicenseName',
'askLicenseUrl',
Expand Down
1 change: 1 addition & 0 deletions src/readme.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ describe('readme', () => {
authorName: 'Franck Abgrall',
authorGithubUsername: 'kefranabg',
authorTwitterUsername: 'FranckAbgrall',
authorPatreonUsername: 'FranckAbgrall',
licenseName: 'MIT',
licenseUrl:
'https://github.com/kefranabg/readme-md-generator/blob/master/LICENSE',
Expand Down
6 changes: 6 additions & 0 deletions templates/default.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ Contributions, issues and feature requests are welcome!<br />Feel free to check
## Show your support

Give a ⭐️ if this project helped you!
<% if (authorPatreonUsername) { -%>

<a href="https://www.patreon.com/<%= authorPatreonUsername %>">
<img src="https://c5.patreon.com/external/logo/[email protected]" width="160">
</a>
<% } -%>
<% if (licenseName && licenseUrl) { -%>

## 📝 License
Expand Down

0 comments on commit 59b57af

Please sign in to comment.