diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 3a4df851..8df70db6 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -18,6 +18,7 @@ Include the hardware you use, such as your computer and other related equipment. * Ensure this PR has a title in the following format * ✅ Add Your Name * ✅ Add @twitterusername + * ✅ Add @mastodonusername@instance.url * ❌ Add myself * ❌ Adding myself! * ❌ Add Your Name @twitter @github diff --git a/contribution-guide.md b/contribution-guide.md index 3b27008b..42bd806f 100644 --- a/contribution-guide.md +++ b/contribution-guide.md @@ -30,6 +30,7 @@ Include the hardware you use, such as your computer and other related equipment. * Ensure this PR has a title in the following format * ✅ Add Your Name * ✅ Add @twitterusername + * ✅ Add @mastodonusername@instance.url * ❌ Add myself * ❌ Adding myself! * ❌ Add Your Name @twitter @github diff --git a/scripts/utils.js b/scripts/utils.js index 2aa0fd8a..2ca3c26e 100644 --- a/scripts/utils.js +++ b/scripts/utils.js @@ -61,6 +61,7 @@ module.exports.Schema = Joi.object({ .valid(...flags) .required(), twitter: Joi.string().pattern(new RegExp(/^@?(\w){1,15}$/)), + mastodon: Joi.string().pattern(new RegExp(/^@(\w){1,30}@(\w)+\.(\w)+$/)), emoji: Joi.string().allow(''), computer: Joi.string().valid('apple', 'windows', 'linux', 'bsd'), phone: Joi.string().valid('iphone', 'android', 'windowsphone', 'flipphone'), diff --git a/src/components/Person.js b/src/components/Person.js index b1e8597a..457b71a4 100644 --- a/src/components/Person.js +++ b/src/components/Person.js @@ -9,6 +9,9 @@ export default function Person({ person }) { const twitter = person.twitter ? `https://unavatar.io/${person.twitter.replace('@', '')}` : null; + const mastodonArr = person.mastodon + ? person.mastodon.replace('@', '').split('@') + : null; const website = `https://unavatar.io/${url.host}`; const unavatar = person.twitter ? `${twitter}?fallback=${website}&ttl=28d` @@ -81,15 +84,23 @@ export default function Person({ person }) { )} - {person.twitter && ( -