Skip to content

Commit

Permalink
Add discord badge
Browse files Browse the repository at this point in the history
  • Loading branch information
vilicvane committed Oct 19, 2023
1 parent 5c4ca21 commit 228f0a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions general/src/composables/README.md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function buildBadges(
repo: repoBadge = false,
coverage: coverageBadge = false,
license: licenseBadge = false,
discord: discordBadgeHref,
} = options ?? {};

const badges: Badge[] = [];
Expand Down Expand Up @@ -118,6 +119,15 @@ function buildBadges(
});
}

if (typeof discordBadgeHref === 'string') {
badges.push({
title: 'Discord',
image:
'https://img.shields.io/badge/chat-discord-5662f6?style=flat-square',
url: discordBadgeHref,
});
}

return badges;

function requireRepositorySpecifier(): string {
Expand Down
1 change: 1 addition & 0 deletions general/src/library/boilerplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const BadgesOptions = x.object({
repo: x.boolean.optional(),
coverage: x.boolean.optional(),
license: x.boolean.optional(),
discord: x.string.optional(),
});

export type BadgesOptions = x.TypeOf<typeof BadgesOptions>;
Expand Down

0 comments on commit 228f0a1

Please sign in to comment.