From c988c3a0dddc6805b1b9577c5173c758c4b45c4a Mon Sep 17 00:00:00 2001 From: Guanzhou Song Date: Fri, 6 Mar 2026 15:39:39 -0500 Subject: [PATCH 1/3] Refresh homepage and download experience Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Guanzhou Song --- app/components/CommandSnippet.tsx | 40 ++ app/components/Navbar.tsx | 2 +- app/docs/[section]/[[...slug]]/page.tsx | 56 +- app/layout.tsx | 4 +- app/packages/page.tsx | 639 ++++++++++++----- app/page.tsx | 907 ++++++++++++------------ app/services/articleService.ts | 150 +++- app/services/metadataService.ts | 6 +- 8 files changed, 1152 insertions(+), 652 deletions(-) create mode 100644 app/components/CommandSnippet.tsx diff --git a/app/components/CommandSnippet.tsx b/app/components/CommandSnippet.tsx new file mode 100644 index 0000000..6d2633f --- /dev/null +++ b/app/components/CommandSnippet.tsx @@ -0,0 +1,40 @@ +"use client"; + +import { useState } from "react"; + +type CommandSnippetProps = { + command: string; + label?: string; +}; + +export default function CommandSnippet({ command, label = "Command" }: CommandSnippetProps) { + const [copied, setCopied] = useState(false); + + const copyCommand = async () => { + await navigator.clipboard.writeText(command); + setCopied(true); + window.setTimeout(() => setCopied(false), 1500); + }; + + return ( +
+
+ + {label} + + +
+
+
+          {command}
+        
+
+
+ ); +} diff --git a/app/components/Navbar.tsx b/app/components/Navbar.tsx index 8d04c4c..e6ab386 100644 --- a/app/components/Navbar.tsx +++ b/app/components/Navbar.tsx @@ -68,7 +68,7 @@ export default function Navbar() { href="/packages" className="text-gray-300 hover:text-blue-400 transition-colors duration-200 font-medium" > - Packages + Download \\ + --password `; + export async function generateStaticParams() { const paths = getAllArticlePaths(); @@ -43,6 +50,11 @@ export async function generateMetadata({ params }: PageProps) { export default async function ArticlePage({ params }: PageProps) { const { section, slug = [] } = await params; + + if (section === 'getting-started' && slug[slug.length - 1] === 'prebuilt-packages') { + redirect('/docs/getting-started/packages'); + } + const articleData = getArticleByPath(section, slug); if (!articleData) { @@ -56,6 +68,7 @@ export default async function ArticlePage({ params }: PageProps) { // Use title from frontmatter if available, otherwise fall back to navigation title or section name const pageTitle = frontmatter.title || selectedNavItem?.title || section; + const showInstallPrimer = section === "getting-started" && file === "index"; return (
@@ -138,6 +151,47 @@ export default async function ArticlePage({ params }: PageProps) { {/* Coming Soon Component for coming-soon layout */} {frontmatter.layout === 'coming-soon' && } + {showInstallPrimer && ( +
+

Install DocumentDB first

+

+ Start with Docker for the fastest setup, or choose Linux packages for persistent servers. +

+
+
+

Quick run with Docker

+ +
+
+

Install from Linux packages

+

+ Use the package finder to generate the exact apt/rpm command for your distro, architecture, and PostgreSQL version. +

+
+ + Docker guide + + + Open package finder + + + Linux packages docs + +
+
+
+
+ )} + {/* Markdown Content */}
diff --git a/app/layout.tsx b/app/layout.tsx index 883e80f..b13b0c4 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -8,7 +8,7 @@ const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = getMetadata({ title: 'DocumentDB - Open Source Document Database', - description: 'A powerful, scalable open-source document database solution. Built on the principles of transparency, developer freedom, and standardization, our mission is to build a MongoDB compatible open source document database based on PostgreSQL.', + description: 'A powerful, scalable open-source document database solution built on PostgreSQL for modern applications.', }); export default function RootLayout({ @@ -34,4 +34,4 @@ export default function RootLayout({ ); -} \ No newline at end of file +} diff --git a/app/packages/page.tsx b/app/packages/page.tsx index 92d04d7..24fd579 100644 --- a/app/packages/page.tsx +++ b/app/packages/page.tsx @@ -1,226 +1,481 @@ +"use client"; + import Link from "next/link"; +import { useState } from "react"; +import CommandSnippet from "../components/CommandSnippet"; + +type InstallMethod = "docker" | "packages"; +type PackageFamily = "apt" | "rpm"; +type AptDistro = "ubuntu22" | "ubuntu24" | "deb11" | "deb12" | "deb13"; +type RpmDistro = "rhel8" | "rhel9"; +type AptArch = "amd64" | "arm64"; +type RpmArch = "x86_64" | "aarch64"; +type AptPgVersion = "16" | "17"; +type RpmPgVersion = "16" | "17"; + +const dockerCommand = `docker run -dt --name documentdb \\ + -p 10260:10260 \\ + ghcr.io/documentdb/documentdb/documentdb-local:latest \\ + --username \\ + --password `; + +const aptTargetLabels: Record = { + ubuntu22: "Ubuntu 22.04 (Jammy)", + ubuntu24: "Ubuntu 24.04 (Noble)", + deb11: "Debian 11 (Bullseye)", + deb12: "Debian 12 (Bookworm)", + deb13: "Debian 13 (Trixie)", +}; + +const rpmTargetLabels: Record = { + rhel8: "RHEL 8 / Rocky 8 / AlmaLinux 8 / CentOS Stream 8", + rhel9: "RHEL 9 / Rocky 9 / AlmaLinux 9 / CentOS Stream 9", +}; + +const nextGuides = [ + { + title: "Getting started", + description: "See the full setup flow and choose the guide that fits your environment.", + href: "/docs/getting-started", + }, + { + title: "Python", + description: "Install PyMongo and connect to your local DocumentDB instance.", + href: "/docs/getting-started/python-setup", + }, + { + title: "Node.js", + description: "Use the Node.js driver and run your first queries locally.", + href: "/docs/getting-started/nodejs-setup", + }, + { + title: "VS Code", + description: "Connect through the VS Code extension for a guided local workflow.", + href: "/docs/getting-started/vscode-quickstart", + }, +] as const; + +const allReleasesUrl = "https://github.com/documentdb/documentdb/releases"; export default function PackagesPage() { + const [method, setMethod] = useState("docker"); + const [packageFamily, setPackageFamily] = useState("apt"); + const [aptTarget, setAptTarget] = useState("ubuntu22"); + const [rpmTarget, setRpmTarget] = useState("rhel9"); + const [aptArch, setAptArch] = useState("amd64"); + const [rpmArch, setRpmArch] = useState("x86_64"); + const [aptPgVersion, setAptPgVersion] = useState("16"); + const [rpmPgVersion, setRpmPgVersion] = useState("16"); + + const aptCommand = `curl -fsSL https://documentdb.io/documentdb-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/documentdb-archive-keyring.gpg && \\ +echo "deb [arch=${aptArch} signed-by=/usr/share/keyrings/documentdb-archive-keyring.gpg] https://documentdb.io/deb stable ${aptTarget}" | sudo tee /etc/apt/sources.list.d/documentdb.list && \\ +sudo apt update && \\ +sudo apt install postgresql-${aptPgVersion}-documentdb`; + const rpmCommand = `sudo dnf install -y dnf-plugins-core && \\ +sudo dnf config-manager --set-enabled crb && \\ +sudo rpm --import https://documentdb.io/documentdb-archive-keyring.gpg && \\ +printf '%s\\n' \\ + '[documentdb]' \\ + 'name=DocumentDB Repository' \\ + 'baseurl=https://documentdb.io/rpm/${rpmTarget}' \\ + 'enabled=1' \\ + 'gpgcheck=1' \\ + 'gpgkey=https://documentdb.io/documentdb-archive-keyring.gpg' | sudo tee /etc/yum.repos.d/documentdb.repo >/dev/null && \\ +sudo dnf install postgresql${rpmPgVersion}-documentdb`; + const selectedPackageName = + packageFamily === "apt" + ? `postgresql-${aptPgVersion}-documentdb` + : `postgresql${rpmPgVersion}-documentdb`; + const selectedTargetText = + packageFamily === "apt" ? aptTargetLabels[aptTarget] : rpmTargetLabels[rpmTarget]; + const selectedArchText = packageFamily === "apt" ? aptArch : rpmArch; + return (
-
- {/* Header */} -
-

- ๐Ÿ“ฆ DocumentDB Package Repository +
+
+

+ Download DocumentDB

-

- Official APT and YUM repositories for DocumentDB packages +

+ Choose Docker for the fastest local setup, or Linux packages for managed host + installations. All packages are GPG-signed and served from the official DocumentDB + repository.

-
- - ๐Ÿ” GPG Signed +
+ + GPG Signed Packages - - ๐Ÿง Multi-Distribution + + Docker + Linux Packages - - ๐Ÿ”„ Auto-Updates + + AMD64 + ARM64
- {/* Quick Install Cards */} -
- {/* Debian/Ubuntu Card */} -
-
-
- - - -
-

Debian/Ubuntu

-
-
- - # Add repository with GPG verification -
- curl -fsSL https://documentdb.io/documentdb-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/documentdb-archive-keyring.gpg -
- echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/documentdb-archive-keyring.gpg] https://documentdb.io/deb stable main" | sudo tee /etc/apt/sources.list.d/documentdb.list -
-
- # Install packages -
- sudo apt update && sudo apt install postgresql-16-documentdb -
-
-
- - Supports: Debian 11/12, Ubuntu 22.04/24.04 - - - AMD64 + ARM64 - -
+
+

1. Choose your install method

+
+ +
+
+ +
+

+ 2. Copy and run this command +

- {/* RHEL/CentOS/Fedora Card */} -
-
-
- - - + {method === "docker" ? ( + <> + +

+ Starts DocumentDB locally on port 10260 for quick evaluation and development. +

+
+ + Open Docker quick start โ†’ +
-

RHEL/CentOS

-
+ + ) : ( + <> +
+

Package Finder

+
+ -
- - # Enable CRB repo (for dependencies) -
- sudo dnf install -y dnf-plugins-core -
- sudo dnf config-manager --set-enabled crb -
-
- # Add repository with GPG verification -
- sudo rpm --import https://documentdb.io/documentdb-archive-keyring.gpg -
- echo '[documentdb] -
- name=DocumentDB Repository -
- baseurl=https://documentdb.io/rpm/rhel9 -
- enabled=1 -
- gpgcheck=1 -
- gpgkey=https://documentdb.io/documentdb-archive-keyring.gpg' | sudo tee /etc/yum.repos.d/documentdb.repo -
-
- # Install packages -
- sudo dnf install postgresql16-documentdb -
-
-
- - Supports: RHEL 8/9, Rocky, AlmaLinux, CentOS Stream - - - x86_64 + aarch64 - -
-
-
+ {packageFamily === "apt" ? ( + + ) : ( + + )} - {/* Installation Guide Link */} -
-
-
-

๐Ÿ“– Complete Installation Guide

-

- Detailed instructions for all distributions, GPG verification, troubleshooting, etc -

-
- - View Guide - -
-
+ {packageFamily === "apt" ? ( + + ) : ( + + )} - {/* Alternative Installation Methods */} -
-

Alternative Installation Methods

- - {/* Direct Downloads */} -
-

- Direct Package Downloads -

-

- Browse and download individual packages without setting up repositories. -

-
+ {packageFamily === "apt" ? ( + + ) : ( + + )} +
+
- {/* Manual Installation */} -
-

Manual Installation

-

- For one-time installations, you can download and install packages manually: -

-
- - # Example: Direct .deb installation
- wget https://documentdb.io/packages/ubuntu22.04-postgresql-16-documentdb_0.107-0_amd64.deb
- sudo dpkg -i ubuntu22.04-postgresql-16-documentdb_0.107-0_amd64.deb
-
- # Example: Direct .rpm installation
- wget https://documentdb.io/packages/rhel8-postgresql16-documentdb-0.107.0-1.el8.x86_64.rpm
- sudo rpm -i rhel8-postgresql16-documentdb-0.107.0-1.el8.x86_64.rpm -
+ +

+ Target: {selectedTargetText} ยท Architecture: {selectedArchText} ยท package name{" "} + {selectedPackageName} +

+
+ + Full package install guide โ†’ + +
+ + )} +
+ +
+
+ + Full package catalog (all supported combinations) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
FormatDistributionsArchitecturesPostgreSQL versionsPackage naming
APTUbuntu 22.04/24.04, Debian 11/12/13amd64, arm6416, 17 + postgresql-<pg>-documentdb +
RPM + RHEL 8/9, Rocky, AlmaLinux, CentOS Stream + x86_64, aarch6416, 17 + postgresql<pg>-documentdb +
+

+ Use Package Finder above to generate the exact command for your selected + target instead of scanning all combinations manually. +

-
-
+ - {/* Package Information */} -
-

Available Packages

- -
-
-

- - - - APT Packages -

-
- Debian 11/12, Ubuntu 22.04/24.04 +
+ + Version pinning and listing available versions + +
+

+ Use the commands below to discover available versions before pinning. Replace{" "} + <VERSION> with the version string + shown by the list command (e.g.{" "} + 0.108-0 for APT,{" "} + 0.108.0-1.el9 for RPM). +

+
+

APT โ€” list then pin

+
+ + apt-cache madison postgresql-16-documentdb + +
+
+ + sudo apt install postgresql-16-documentdb=<VERSION> + +
-
    -
  • โ€ข postgresql-15-documentdb
  • -
  • โ€ข postgresql-16-documentdb
  • -
  • โ€ข postgresql-17-documentdb
  • -
+
+

RPM โ€” list then pin

+
+ + dnf --showduplicates list postgresql16-documentdb + +
+
+ + sudo dnf install postgresql16-documentdb-<VERSION> + +
+
+

+ See all releases and release notes on{" "} + + GitHub Releases + + . +

- -
-

- - - - RPM Packages -

-
- RHEL 8/9, CentOS, Fedora +
+ +
+ + Direct package downloads + +
+

+ Individual .deb and{" "} + .rpm files are attached to each release on + GitHub. Package names follow the convention: +

+
+
ubuntu22.04-postgresql-16-documentdb_<VERSION>_amd64.deb
+
rhel9-postgresql16-documentdb-<VERSION>.el9.x86_64.rpm
-
    -
  • โ€ข postgresql16-documentdb
  • -
  • โ€ข postgresql17-documentdb
  • -
+ + Browse releases on GitHub โ†’ +
-
+ -
-
- - - -
-

Multi-Architecture Support

-

- All packages support both AMD64 and ARM64 architectures (including Apple Silicon, AWS Graviton, etc.) -

+
+ + Troubleshooting quick checks + +
+
+ + sudo apt update && apt search documentdb && apt-cache policy + postgresql-16-documentdb + +
+
+ + sudo dnf clean all && dnf search documentdb && rpm -qi postgresql16-documentdb +
+
+ + +
+
+

+ 3. Connect and try it +

+

Choose your next guide

+

+ Once DocumentDB is running, use port 10260 and follow one of these guides to make + your first connection. +

-
+
+ {nextGuides.map((guide) => ( + +

+ {guide.title} +

+

{guide.description}

+ + ))} +
+ +
+ + Linux package guide + + + All docs + +
+
); diff --git a/app/page.tsx b/app/page.tsx index 331923c..38fee36 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,491 +1,504 @@ +import Image from "next/image"; +import Link from "next/link"; +import CommandSnippet from "./components/CommandSnippet"; + +type CapabilityIconName = + | "foundation" + | "index" + | "vector" + | "platform"; + +const quickRunCommand = `docker run -dt --name documentdb \\ + -p 10260:10260 \\ + ghcr.io/documentdb/documentdb/documentdb-local:latest \\ + --username \\ + --password `; + +const quickStartSteps = [ + { + step: "01", + description: "Run DocumentDB Local with Docker.", + }, + { + step: "02", + description: "Connect on port 10260 with your app, shell, or client.", + }, + { + step: "03", + description: "Continue with the docs or prebuilt packages.", + }, +]; + +const whyDocumentDB = [ + { + title: "Native BSON", + description: + "Built for document flexibility on PostgreSQL.", + }, + { + title: "PostgreSQL foundation", + description: + "Use advanced SQL, proven operations, and rich indexing when you need them.", + }, + { + title: "Open and portable", + description: + "MIT licensed, runs locally with Docker, and fits your own infrastructure or cloud.", + }, +]; + +const capabilities = [ + { + eyebrow: "Foundation", + title: "Document + SQL", + description: + "Native BSON support with full PostgreSQL compatibility when you need advanced SQL.", + highlights: ["Native BSON", "Advanced SQL"], + icon: "foundation" as const, + }, + { + eyebrow: "Indexing", + title: "Rich indexing", + description: + "Single-field, multi-key, compound, text, and geospatial indexes, including nested fields.", + highlights: ["Nested fields", "Text + geo"], + icon: "index" as const, + }, + { + eyebrow: "AI", + title: "Vector search", + description: + "Embeddings and similarity search powered by pg_vector.", + highlights: ["Embeddings", "Similarity"], + icon: "vector" as const, + }, + { + eyebrow: "Open source", + title: "Open and secure", + description: + "MIT licensed with SCRAM authentication and a lightweight local runtime for development and testing.", + highlights: ["MIT licensed", "SCRAM auth"], + icon: "platform" as const, + }, +]; + +const trustBadges = [ + "Built on PostgreSQL", + "Native BSON", + "MIT licensed", + "Runs locally with Docker", +]; + +const credibilityPoints = [ + { + value: "3.2k+", + label: "GitHub stars", + detail: "on documentdb/documentdb", + }, + { + value: "200+", + label: "Public forks", + detail: "public on GitHub", + }, + { + value: "11", + label: "TSC members", + detail: "representing 5 organizations", + }, +]; + +const contributorLogos = [ + { + name: "Microsoft", + src: "/images/AzureLogo.png", + }, + { + name: "Amazon", + src: "/images/AWS%20Logo.png", + }, + { + name: "Rippling", + src: "/images/Rippling%20Logo%20no%20background.png", + }, + { + name: "YugabyteDB", + src: "/images/YugabyteLogo.png", + }, + { + name: "AB InBev", + src: "/images/AB%20InBev%20transparent%20logo.png", + }, +]; + +function CapabilityIcon({ name }: { name: CapabilityIconName }) { + switch (name) { + case "foundation": + return ( + + + + + + + ); + case "index": + return ( + + + + ); + case "vector": + return ( + + + + + + + ); + case "platform": + return ( + + + + + ); + } +} + export default function Home() { return (
- {/* Hero Banner */} -
-
-
-
-

- DocumentDB -

-

- A powerful, scalable, MongoDB compatible open-source document database built for modern applications -

- -
-
-
- {/* Mission Statement Section */} -
-
-
-

- Our Mission -

-

- Built on the principles of transparency, developer freedom, and - standardization, our mission is to build a MongoDB compatible open - source document database based on PostgreSQL -

-
- -
-
-
- - - - -
-

Transparency

-

- We want to ensure developers have full transparency into the underlying architecture of the engine +

+
+
+
+
+

+ Open source document database

-
- -
-
- - - -
-

Developer Freedom

-

- With the MIT license, users have complete freedom to use the project as they please with no restrictions +

+ DocumentDB +

+

+ Built for document workloads. Powered by PostgreSQL. +

+

+ Open source and MIT licensed, with native BSON, advanced + indexing, and vector search on PostgreSQL.

+
+ + Get Started + + + Download + + + View Docs + +
+
+ {trustBadges.map((badge) => ( + + {badge} + + ))} +
-
-
- - - +
+
+ + Quick start + +

+ Run locally with Docker +

+

+ Start DocumentDB Local with Docker, then connect on port + 10260. +

+
+ +
    + {quickStartSteps.map((item) => ( +
  1. + + {item.step} + +

    + {item.description} +

    +
  2. + ))} +
+
+ + Docker quick start + + + Download packages +
-

Open Standard

-

- Eventually, we want to create an open standard for document databases for a universally accepted implementation standard -

- {/* In the Press Section */} -
-
-
-

- In the Press +
+
+
+

+ Capabilities +

+

+ Core features for document workloads

-

- What the industry is saying about DocumentDB +

+ From CRUD to vector search, all on PostgreSQL.

-
- {/* The Register Article */} - -
-
-
- The Register -
- - The Register - -

- Microsoft builds open source document database -

-

- PostgreSQL-powered platform -

-
- Read - - - -
-
-
-
- - {/* Hacker News Discussion */} - -
-
-
- - - - Y - - -
- - Hacker News - -

- DocumentDB Open-Source Discussion -

-

- Community discussion -

-
- Join - - - -
-
-
-
- - {/* Phoronix Article */} - -
- {/* Our Trusted Partners Section */} -
- {/* Artistic background elements */} -
-
-
-
-
-
- -
-
-

- Our Contributors +
+
+
+

+ Why DocumentDB

-

- Collaborating with industry leaders to advance the document - database ecosystem +

+ Document flexibility, PostgreSQL confidence, and open-source control.

-
-
- {/* Microsoft Azure */} -
-
-
-
- Microsoft Azure -
-
-

- Microsoft -

-
-
-
- - {/* Amazon DocumentDB */} -
-
-
-
- Amazon Web Services -
-
-

- Amazon -

-
-
-
- - {/* Rippling */} -
-
-
-
- Rippling -
-
-

- Rippling -

-
-
-
+
+ {whyDocumentDB.map((item) => ( +
+

+ {item.title} +

+

+ {item.description} +

+
+ ))} +
+
+
- {/* YugabyteDB */} -
-
-
-
- YugabyteDB -
-
-

- YugabyteDB -

-
-
-
+
+
+
+

+ Community +

+

+ Built in the open +

+

+ MIT licensed, active on GitHub, and guided by a technical + steering committee that spans five organizations. +

+
- {/* AB InBev */} -
-
-
-
- AB InBev -
-
-

- AB InBev -

-
+
+ {credibilityPoints.map((item) => ( +
+

+ {item.value} +

+

+ {item.label} +

+

+ {item.detail} +

-
+ ))}
- {/* Artistic connection lines */} -
- - - - - - - - - - +

+ Current TSC representation includes Microsoft, Amazon, AB InBev, + Rippling, and YugabyteDB. +

+
+ {contributorLogos.map((organization, index) => ( +
- - - - - - +
+ {organization.name} +
+
+ ))} +
- {/* CTA Section */} -
-
-

- Ready to Get Started? +
+
+

+ Ready to try DocumentDB?

-

- Join us as we build the future of document databases together +

+ Start locally with Docker, then explore the project on GitHub.

- - - - - View on GitHub - +
+ + Get Started + + + GitHub + +
-

- ) + ); } diff --git a/app/services/articleService.ts b/app/services/articleService.ts index 0da835a..d64c7ee 100644 --- a/app/services/articleService.ts +++ b/app/services/articleService.ts @@ -6,6 +6,104 @@ import { Article } from '../types/Article'; import { Link } from '../types/Link'; const articlesDirectory = path.join(process.cwd(), 'articles'); +const dockerGuideContent = `# Docker + +Run DocumentDB locally in minutes using Docker. + +## Start DocumentDB + +\`\`\`bash +docker run -dt --name documentdb \\ + -p 10260:10260 \\ + ghcr.io/documentdb/documentdb/documentdb-local:latest \\ + --username \\ + --password +\`\`\` + +> Replace \`\` and \`\` with your own credentials. + +## Verify the container + +\`\`\`bash +docker ps --filter "name=documentdb" +\`\`\` + +## Next steps + +- [Node.js Setup Guide](/docs/getting-started/nodejs-setup) +- [Python Setup Guide](/docs/getting-started/python-setup) +- [Linux Packages Guide](/docs/getting-started/packages) +- [Package Finder](/packages) +`; + +const linuxPackagesGuideContent = `# Linux Packages + +Install DocumentDB on Linux hosts with apt/rpm packages. + +## Fastest path + +Use the [Package Finder](/packages) to generate the exact install command for your distro, architecture, and PostgreSQL version. + +## APT example + +\`\`\`bash +curl -fsSL https://documentdb.io/documentdb-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/documentdb-archive-keyring.gpg && \\ +echo "deb [arch=amd64 signed-by=/usr/share/keyrings/documentdb-archive-keyring.gpg] https://documentdb.io/deb stable ubuntu24" | sudo tee /etc/apt/sources.list.d/documentdb.list && \\ +sudo apt update && \\ +sudo apt install postgresql-16-documentdb +\`\`\` + +## RPM example + +\`\`\`bash +sudo dnf install -y dnf-plugins-core && \\ +sudo dnf config-manager --set-enabled crb && \\ +sudo rpm --import https://documentdb.io/documentdb-archive-keyring.gpg && \\ +printf '%s\\n' '[documentdb]' 'name=DocumentDB Repository' 'baseurl=https://documentdb.io/rpm/rhel9' 'enabled=1' 'gpgcheck=1' 'gpgkey=https://documentdb.io/documentdb-archive-keyring.gpg' | sudo tee /etc/yum.repos.d/documentdb.repo >/dev/null && \\ +sudo dnf install postgresql16-documentdb +\`\`\` + +## Next steps + +- [Docker Quick Start](/docs/getting-started/docker) +- [Node.js Setup Guide](/docs/getting-started/nodejs-setup) +- [Python Setup Guide](/docs/getting-started/python-setup) +`; + +function splitPrebuiltNavigation(section: string, links: Link[]): Link[] { + if (section !== 'getting-started') { + return links; + } + + const isPrebuiltPackages = (link: Link) => + link.link.includes('prebuilt-packages') || /pre-built packages/i.test(link.title); + const dockerAndLinuxLinks: Link[] = [ + { + title: 'Docker', + link: '/docs/getting-started/docker', + }, + { + title: 'Linux Packages', + link: '/docs/getting-started/packages', + }, + ]; + const filteredLinks = links.filter((link) => !isPrebuiltPackages(link)); + const gettingStartedIndex = filteredLinks.find((link) => link.link === 'index.md'); + + if (!gettingStartedIndex) { + return [...dockerAndLinuxLinks, ...filteredLinks]; + } + + const remainingLinks = filteredLinks.filter((link) => link !== gettingStartedIndex); + return [gettingStartedIndex, ...dockerAndLinuxLinks, ...remainingLinks]; +} + +function updateGettingStartedIndexContent(content: string): string { + return content.replace( + /- \[Pre-built Packages\]\([^)]+\) - [^\n]+/i, + '- [Docker](/docs/getting-started/docker) - Start DocumentDB locally with Docker\n- [Linux Packages](/docs/getting-started/packages) - Install via apt/rpm repositories' + ); +} export function getArticleContent(): Article { const contentPath = path.join(articlesDirectory, 'content.yml'); @@ -22,9 +120,10 @@ export function getArticleNavigation(section: string): Link[] { const fileContents = fs.readFileSync(navPath, 'utf8'); const rawLinks = yaml.load(fileContents) as Link[]; + const normalizedLinks = splitPrebuiltNavigation(section, rawLinks); // Transform Markdown file links to published relative URIs - return rawLinks.map(link => { + return normalizedLinks.map(link => { // Convert .md file references to proper URIs // e.g., "index.md" -> "/docs/section" // e.g., "nodejs-setup.md" -> "/docs/section/nodejs-setup" @@ -89,9 +188,20 @@ export function getAllArticlePaths(): { section: string; slug: string[] }[] { paths.push({ section, slug: [file] }); } }); + + if (section === 'getting-started') { + paths.push({ section, slug: ['docker'] }); + paths.push({ section, slug: ['packages'] }); + } + }); + + const uniquePaths = new Map(); + paths.forEach((entry) => { + const key = `${entry.section}/${entry.slug.join('/')}`; + uniquePaths.set(key, entry); }); - return paths; + return Array.from(uniquePaths.values()); } export function getArticleByPath(section: string, slug: string[] = []): { @@ -105,6 +215,34 @@ export function getArticleByPath(section: string, slug: string[] = []): { file: string; } | null { const file = slug.length > 0 ? slug[slug.length - 1] : 'index'; + const navigation = getArticleNavigation(section); + + if (section === 'getting-started' && file === 'docker') { + return { + content: dockerGuideContent, + frontmatter: { + title: 'Docker', + description: 'Run DocumentDB locally using Docker.', + }, + navigation, + section, + file, + }; + } + + if (section === 'getting-started' && file === 'packages') { + return { + content: linuxPackagesGuideContent, + frontmatter: { + title: 'Linux Packages', + description: 'Install DocumentDB via apt and rpm packages.', + }, + navigation, + section, + file, + }; + } + const rawContent = getMarkdownContent(section, file); if (!rawContent) { @@ -113,11 +251,13 @@ export function getArticleByPath(section: string, slug: string[] = []): { // Parse front matter const { data: frontmatter, content } = matter(rawContent); - - const navigation = getArticleNavigation(section); + const normalizedContent = + section === 'getting-started' && file === 'index' + ? updateGettingStartedIndexContent(content) + : content; return { - content, + content: normalizedContent, frontmatter, navigation, section, diff --git a/app/services/metadataService.ts b/app/services/metadataService.ts index b645edf..2d83ee8 100644 --- a/app/services/metadataService.ts +++ b/app/services/metadataService.ts @@ -52,11 +52,9 @@ const getBaseKeywords = (): string[] => [ 'open source', 'NoSQL', 'database', - 'MongoDB compatible', 'PostgreSQL', - 'MQL', - 'MongoDB Query Language', + 'document data API', 'JSON documents', 'scalable database', 'distributed database', -]; \ No newline at end of file +]; From 50d79ad2c0722c604bb99d68e2413a0376c232d1 Mon Sep 17 00:00:00 2001 From: Guanzhou Song Date: Fri, 6 Mar 2026 15:55:51 -0500 Subject: [PATCH 2/3] Fix GitHub Pages base path Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Guanzhou Song --- app/components/Navbar.tsx | 11 ++++++++--- app/page.tsx | 5 +++-- app/services/sitePath.ts | 12 ++++++++++++ next.config.ts | 15 +++++++++++++-- 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 app/services/sitePath.ts diff --git a/app/components/Navbar.tsx b/app/components/Navbar.tsx index e6ab386..048c031 100644 --- a/app/components/Navbar.tsx +++ b/app/components/Navbar.tsx @@ -1,4 +1,6 @@ +import Image from "next/image"; import Link from "next/link"; +import { withBasePath } from "../services/sitePath"; export default function Navbar() { return (

+

Once DocumentDB is running, use port 10260 and follow one of these guides to make your first connection.