From 6c7f087846af3a4990158564284e8ba026eeacc0 Mon Sep 17 00:00:00 2001 From: Guanzhou Song Date: Thu, 30 Jul 2026 12:33:34 -0400 Subject: [PATCH] Centralize the Discord invite link The discord.gg/vH7bYu524D invite was hardcoded in three places: the Next.js navbar, the VS Code quick-start guide content, and the Jekyll blog layout. If the invite ever expires or rotates, each copy has to be found and updated separately. The Next.js app now reads it from app/services/externalLinks.ts (which already exists for exactly this purpose), and the Jekyll side reads site.discord_url from blogs/_config.yml, leaving one definition per stack with cross-references in comments. --- app/components/Navbar.tsx | 3 ++- app/services/articleService.ts | 3 ++- app/services/externalLinks.ts | 2 ++ blogs/_config.yml | 3 +++ blogs/_layouts/default.html | 2 +- 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/components/Navbar.tsx b/app/components/Navbar.tsx index 5ec97c7..9a8087a 100644 --- a/app/components/Navbar.tsx +++ b/app/components/Navbar.tsx @@ -3,6 +3,7 @@ import { useState } from "react"; import Image from "next/image"; import Link from "next/link"; +import { documentdbDiscordUrl } from "../services/externalLinks"; import { withBasePath } from "../services/sitePath"; type NavItem = { @@ -24,7 +25,7 @@ const navItems: NavItem[] = [ }, { label: "Discord", - href: "https://discord.gg/vH7bYu524D", + href: documentdbDiscordUrl, kind: "anchor", newTab: true, icon: "discord", diff --git a/app/services/articleService.ts b/app/services/articleService.ts index 4fa0a52..d8fdc59 100644 --- a/app/services/articleService.ts +++ b/app/services/articleService.ts @@ -5,6 +5,7 @@ import matter from 'gray-matter'; import { Article } from '../types/Article'; import { Link } from '../types/Link'; import { buildAptInstallCommand, buildRpmInstallCommand } from '../lib/packageInstall'; +import { documentdbDiscordUrl } from './externalLinks'; const articlesDirectory = path.join(process.cwd(), 'articles'); const dockerGuideContent = `# Docker Quick Start @@ -372,7 +373,7 @@ For extension-specific help or bugs: - [GitHub repository](https://github.com/microsoft/vscode-documentdb) - [GitHub discussions](https://github.com/microsoft/vscode-documentdb/discussions) - [GitHub issues](https://github.com/microsoft/vscode-documentdb/issues) -- [DocumentDB Discord](https://discord.gg/vH7bYu524D) +- [DocumentDB Discord](${documentdbDiscordUrl}) ## Next steps diff --git a/app/services/externalLinks.ts b/app/services/externalLinks.ts index eab069c..bc7b4c6 100644 --- a/app/services/externalLinks.ts +++ b/app/services/externalLinks.ts @@ -1,3 +1,5 @@ +export const documentdbDiscordUrl = 'https://discord.gg/vH7bYu524D'; + export const documentdbKubernetesOperatorDocsUrl = 'https://documentdb.io/documentdb-kubernetes-operator/preview/'; diff --git a/blogs/_config.yml b/blogs/_config.yml index f9503d1..3f0faa6 100644 --- a/blogs/_config.yml +++ b/blogs/_config.yml @@ -1,5 +1,8 @@ title: DocumentDB Blog description: Insights, updates, and deep dives into the world of document databases and open-source innovation. +# Shared external links. The Next.js app keeps the same values in +# app/services/externalLinks.ts; update both when one changes. +discord_url: https://discord.gg/vH7bYu524D baseurl: /blogs url: "" permalink: pretty diff --git a/blogs/_layouts/default.html b/blogs/_layouts/default.html index 5d49624..207308d 100644 --- a/blogs/_layouts/default.html +++ b/blogs/_layouts/default.html @@ -31,7 +31,7 @@