--- import { getCollection } from 'astro:content'; import '~/styles/anhh-tokens.css'; import '@fontsource-variable/inter'; interface Product { slug: string; title: string; blurb: string; href: string; count: number; } // Hardcoded product metadata. Adding a new product = adding to this map. const PRODUCT_META: Record = { whp: { title: 'WHP', blurb: 'Our hosting control panel. Add domains, create sites, manage email, set up backups.', firstSection: 'getting-started/welcome', }, wordpress: { title: 'WordPress', blurb: 'Tips and tricks for getting the most out of WordPress on WHP.', firstSection: 'index', }, email: { title: 'Email', blurb: 'Set up Outlook, Apple Mail, Thunderbird, and mobile clients — plus news about our filtering.', firstSection: 'set-up-your-email-client', }, domains: { title: 'Domains', blurb: 'Transfer a domain to us, point it at your hosting, and sort out DNS problems.', firstSection: 'transferring-a-domain-to-us', }, cpanel: { title: 'cPanel hosting', blurb: 'Nameservers, SSL certificates, permissions, and email for our cPanel shared and reseller plans.', firstSection: 'nameservers', }, support: { title: 'Support', blurb: 'Working with our support team, including remote-assistance sessions.', firstSection: 'remote-support', }, }; const docs = await getCollection('docs'); // Group articles by top-level product folder const byProduct = new Map(); for (const entry of docs) { const product = entry.id.split('/')[0]; byProduct.set(product, (byProduct.get(product) ?? 0) + 1); } const visibleProducts: Product[] = Array.from(byProduct.entries()) .filter(([slug]) => PRODUCT_META[slug] !== undefined) .filter(([, count]) => count > 0) .map(([slug, count]) => ({ slug, title: PRODUCT_META[slug].title, blurb: PRODUCT_META[slug].blurb, href: `/${slug}/${PRODUCT_META[slug].firstSection}/`, count, })) .sort((a, b) => a.title.localeCompare(b.title)); --- AnHonestHost Knowledge Base
AnHonestHost Knowledge Base

Knowledge Base

Pick a product to get started.

{ visibleProducts.length === 0 ? (
No documentation has been published yet.
) : ( ) }