From b379874d87bf9af9ee12e59ae2e2f438462bdd81 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sun, 13 Sep 2026 16:30:06 -0700 Subject: [PATCH 1/2] doc: show GitHub stars and Discord members in the navbar Replaces the stock GitHub and Discord social links with a small component using the hand-drawn icons from moq.dev, each with a live count fetched in the browser and cached in localStorage for an hour. The stock social links now hold @kixelated's X, Bluesky, and LinkedIn. Co-Authored-By: Claude Opus 5 --- doc/.vitepress/config.ts | 7 +- doc/.vitepress/theme/Community.vue | 109 +++++++++++++++++++++++++++++ doc/.vitepress/theme/index.js | 5 +- doc/public/emoji/discord.svg | 66 +++++++++++++++++ doc/public/emoji/github.svg | 50 +++++++++++++ 5 files changed, 234 insertions(+), 3 deletions(-) create mode 100644 doc/.vitepress/theme/Community.vue create mode 100644 doc/public/emoji/discord.svg create mode 100644 doc/public/emoji/github.svg diff --git a/doc/.vitepress/config.ts b/doc/.vitepress/config.ts index e816e25ebb..613e7df4ad 100644 --- a/doc/.vitepress/config.ts +++ b/doc/.vitepress/config.ts @@ -193,9 +193,12 @@ export default defineConfig({ ], }, + // GitHub and Discord are rendered by theme/Community.vue instead, with + // live counts and the hand-drawn icons from moq.dev. socialLinks: [ - { icon: "github", link: "https://github.com/moq-dev/moq" }, - { icon: "discord", link: "https://discord.gg/FCYF3p99mr" }, + { icon: "x", link: "https://x.com/kixelated" }, + { icon: "bluesky", link: "https://bsky.app/profile/kixel.me" }, + { icon: "linkedin", link: "https://www.linkedin.com/in/luke-curley-635a457/" }, ], editLink: { diff --git a/doc/.vitepress/theme/Community.vue b/doc/.vitepress/theme/Community.vue new file mode 100644 index 0000000000..7115669bd4 --- /dev/null +++ b/doc/.vitepress/theme/Community.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/doc/.vitepress/theme/index.js b/doc/.vitepress/theme/index.js index c4fdf26edc..9f500b36a6 100644 --- a/doc/.vitepress/theme/index.js +++ b/doc/.vitepress/theme/index.js @@ -1,14 +1,17 @@ import { h } from "vue"; import DefaultTheme from "vitepress/theme"; import Banner from "./Banner.vue"; +import Community from "./Community.vue"; import "./custom.css"; export default { extends: DefaultTheme, Layout() { - // Render the site-wide notice above every page via the layout-top slot. + // Render the site-wide notice above every page via the layout-top slot, + // and the GitHub/Discord counts at the end of the navbar. return h(DefaultTheme.Layout, null, { "layout-top": () => h(Banner), + "nav-bar-content-after": () => h(Community), }); }, }; diff --git a/doc/public/emoji/discord.svg b/doc/public/emoji/discord.svg new file mode 100644 index 0000000000..df2ce338a1 --- /dev/null +++ b/doc/public/emoji/discord.svg @@ -0,0 +1,66 @@ + + + + + diff --git a/doc/public/emoji/github.svg b/doc/public/emoji/github.svg new file mode 100644 index 0000000000..1ddcb5cb98 --- /dev/null +++ b/doc/public/emoji/github.svg @@ -0,0 +1,50 @@ + + + From 7029d5af6bc68ab9ab38ca7c3afbd8ea05642a7a Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Thu, 17 Sep 2026 15:41:59 -0700 Subject: [PATCH 2/2] fix(doc): keep community links on mobile and cache a complete pair GitHub and Discord stay in socialLinks so the mobile overlay still has them. The desktop navbar hides those two stock icons because Community.vue already shows them with counts. Cache the stats pair only when both fetches succeed so a missing metric is retried. Co-Authored-By: grok-4.6 --- doc/.vitepress/config.ts | 8 ++++++-- doc/.vitepress/theme/Community.vue | 5 +++-- doc/.vitepress/theme/custom.css | 8 ++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/.vitepress/config.ts b/doc/.vitepress/config.ts index 613e7df4ad..7a6b76a0f6 100644 --- a/doc/.vitepress/config.ts +++ b/doc/.vitepress/config.ts @@ -193,9 +193,13 @@ export default defineConfig({ ], }, - // GitHub and Discord are rendered by theme/Community.vue instead, with - // live counts and the hand-drawn icons from moq.dev. + // GitHub and Discord stay here so the mobile overlay still has them. + // theme/Community.vue is the desktop pair, with live counts and the + // hand-drawn icons from moq.dev; custom.css hides these two in the + // navbar so they do not duplicate. socialLinks: [ + { icon: "github", link: "https://github.com/moq-dev/moq" }, + { icon: "discord", link: "https://discord.gg/FCYF3p99mr" }, { icon: "x", link: "https://x.com/kixelated" }, { icon: "bluesky", link: "https://bsky.app/profile/kixel.me" }, { icon: "linkedin", link: "https://www.linkedin.com/in/luke-curley-635a457/" }, diff --git a/doc/.vitepress/theme/Community.vue b/doc/.vitepress/theme/Community.vue index 7115669bd4..2dd8b312d4 100644 --- a/doc/.vitepress/theme/Community.vue +++ b/doc/.vitepress/theme/Community.vue @@ -1,7 +1,8 @@