diff --git a/src/components/OpenSourceBanner.astro b/src/components/OpenSourceBanner.astro index 020f79900..75062de04 100644 --- a/src/components/OpenSourceBanner.astro +++ b/src/components/OpenSourceBanner.astro @@ -30,12 +30,12 @@ const starCount = await getFormattedStars('kamranahmedse/developer-roadmap'); - Join on Discord / New + Join on Discord diff --git a/src/data/roadmaps/mongodb/mongodb.md b/src/data/roadmaps/mongodb/mongodb.md index 7d54b0019..63d1c2a50 100644 --- a/src/data/roadmaps/mongodb/mongodb.md +++ b/src/data/roadmaps/mongodb/mongodb.md @@ -41,6 +41,7 @@ seo: - 'mongodb quiz' - 'mongodb interview questions' relatedRoadmaps: + - 'postgresql-dba' - 'backend' - 'nodejs' - 'system-design' diff --git a/src/data/roadmaps/postgresql-dba/postgresql-dba.md b/src/data/roadmaps/postgresql-dba/postgresql-dba.md index 7bb1f6dd4..08f2254b3 100644 --- a/src/data/roadmaps/postgresql-dba/postgresql-dba.md +++ b/src/data/roadmaps/postgresql-dba/postgresql-dba.md @@ -2,7 +2,7 @@ jsonUrl: '/jsons/roadmaps/postgresql-dba.json' pdfUrl: '/pdfs/roadmaps/postgresql-dba.pdf' order: 5 -briefTitle: 'DBA' +briefTitle: 'PostgreSQL' briefDescription: 'Step by step guide to become a PostgreSQL DBA in 2023' title: 'PostgreSQL DBA' description: 'Step by step guide to becoming a modern PostgreSQL DB Administrator in 2023' @@ -33,6 +33,7 @@ seo: - 'database administrator quiz' - 'dba interview questions' relatedRoadmaps: + - 'mongodb' - 'backend' - 'devops' sitemap: @@ -251,4 +252,4 @@ Get involved to Postgres community and contribute to Postgres; be a useful membe - pgsql-hackers - pgsql-bugs - Reviewing patches -- Writing patches, attending in [Commitfests](https://commitfest.postgresql.org/) \ No newline at end of file +- Writing patches, attending in [Commitfests](https://commitfest.postgresql.org/) diff --git a/src/lib/discord.ts b/src/lib/discord.ts new file mode 100644 index 000000000..314dc2135 --- /dev/null +++ b/src/lib/discord.ts @@ -0,0 +1,23 @@ +const formatter = Intl.NumberFormat('en-US', { + notation: 'compact', +}); + +export async function getDiscordInfo(): Promise<{ + url: string; + total: number; + totalFormatted: string; + online: number; + onlineFormatted: string; +}> { + const response = await fetch( + 'https://discord.com/api/v9/invites/cJpEt5Qbwa?with_counts=true' + ); + const json = await response.json(); + return { + url: `https://discord.gg/${json.code}`, + total: json.approximate_member_count, + totalFormatted: formatter.format(json.approximate_member_count), + online: json.approximate_presence_count, + onlineFormatted: formatter.format(json.approximate_presence_count), + }; +}