From 884f0b1862956c648567ac3d84457848c7134824 Mon Sep 17 00:00:00 2001 From: mehfuz Date: Sun, 8 Nov 2026 12:56:37 -0800 Subject: [PATCH] Add a docent landing page at /docent A page to link from posts and launches, so docent traffic shows up as its own page in analytics. Copying the install command now sends a docent_install_copy event tagged with the platform and the page. --- src/components/DocentInstall/index.tsx | 4 +- src/pages/docent.tsx | 153 +++++++++++++++++++++++++ 2 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 src/pages/docent.tsx diff --git a/src/components/DocentInstall/index.tsx b/src/components/DocentInstall/index.tsx index 7c8ff91..c086758 100644 --- a/src/components/DocentInstall/index.tsx +++ b/src/components/DocentInstall/index.tsx @@ -11,7 +11,8 @@ const installCommands: Record = { windows: 'irm https://smartloop.ai/install.ps1 | iex', }; -export default function DocentInstall(): ReactNode { +// `location` tags the copy event in analytics (homepage vs /docent). +export default function DocentInstall({ location = 'home' }: { location?: string }): ReactNode { const [shell, setShell] = useState('unix'); const [copied, setCopied] = useState(false); @@ -24,6 +25,7 @@ export default function DocentInstall(): ReactNode { try { await navigator.clipboard.writeText(installCommands[shell]); setCopied(true); + (window as { gtag?: (...args: unknown[]) => void }).gtag?.('event', 'docent_install_copy', { platform: shell, location }); setTimeout(() => setCopied(false), 1500); } catch { /* clipboard blocked: the command is still selectable */ diff --git a/src/pages/docent.tsx b/src/pages/docent.tsx new file mode 100644 index 0000000..f223855 --- /dev/null +++ b/src/pages/docent.tsx @@ -0,0 +1,153 @@ +import { useEffect, type ReactNode } from 'react'; +import Link from '@docusaurus/Link'; +import Head from '@docusaurus/Head'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import Header from '../components/Header'; +import Footer from '../components/Footer'; +import DocentInstall from '../components/DocentInstall'; +import styles from './home.module.css'; + +// smartloop.ai/docent: the page to link from posts and launches, so docent +// traffic shows up as its own page in analytics (with any utm_* tags on the +// link) instead of blending into the homepage. + +const DESCRIPTION = + 'docent is an open-source AI coding agent for your terminal that runs on open models. It writes code as diffs, checks it against your language servers and build, fixes its own errors, and runs the commands once you say so.'; + +const points: [string, string][] = [ + ['Writes code.', 'New files whole, changes as small edits, each shown as a diff as it streams.'], + ['Checks its work.', 'Runs your language servers and build, and hands errors back to the model until it passes.'], + ['Runs the work.', 'Commits, installs and tests, once you say so.'], + ['Open models.', 'No vendor lock-in: pick the model, and run it locally so your code stays private.'], +]; + +const steps: [string, string][] = [ + ['Install', 'Run the one-liner above. It puts docent on your PATH.'], + ['Open a project', 'cd into a repo and run docent. It downloads the models it needs the first time.'], + ['Ask for a change', 'Describe what you want. docent writes it, builds it and fixes what breaks.'], +]; + +function Check(): ReactNode { + return ( + + + + ); +} + +export default function Docent(): ReactNode { + const { siteConfig } = useDocusaurusContext(); + // Latest Docent CLI version, baked in at build time (docusaurus.config.ts). + const docentVersion = siteConfig.customFields?.docentVersion as string | null | undefined; + + // Keep campaign tags for the session, as the homepage does. + useEffect(() => { + const params = new URLSearchParams(window.location.search); + ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content'].forEach((key) => { + const value = params.get(key); + if (value) sessionStorage.setItem(key, value); + }); + }, []); + + const jsonLd = { + '@context': 'https://schema.org', + '@type': 'SoftwareApplication', + name: 'docent', + applicationCategory: 'DeveloperApplication', + operatingSystem: 'macOS, Linux, Windows', + description: DESCRIPTION, + url: 'https://smartloop.ai/docent', + license: 'https://opensource.org/licenses/MIT', + offers: { '@type': 'Offer', price: '0', priceCurrency: 'USD' }, + author: { '@type': 'Organization', name: 'Smartloop Inc.', url: 'https://smartloop.ai' }, + }; + + return ( +
+ + docent | Open-source AI coding agent for your terminal + + + + + + +
+
+
+
+
+ +
+
+
+

What it does

+

Ask for a change. Get a build that passes.

+
    + {points.map(([title, desc]) => ( +
  • {title} {desc}
  • + ))} +
+
+
+
+ + docent + local +
+ {/* One recording per site theme; CSS hides the other. */} + {(['light', 'dark'] as const).map((theme) => ( +
+
+
+ +
+
+

Get started

+

Three steps, then you're coding.

+
    + {steps.map(([title, desc], i) => ( +
  1. + {String(i + 1).padStart(2, '0')} +

    {title}

    +

    {desc}

    +
  2. + ))} +
+
+
+
+
+
+
+ ); +}