Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

3.2 KB
Raw Blame
import { unified } from '@astrojs/markdown-remark';
import sitemap from '@astrojs/sitemap';
import starlight from '@astrojs/starlight';
import { defineConfig } from 'astro/config';

import { rehypePagefindCommandReferences } from './src/plugins/pagefind-command-references.mjs';
import { rehypeResponsiveTables } from './src/plugins/responsive-tables.mjs';
import { rehypeStableHeadingIds } from './src/plugins/stable-heading-ids.mjs';
import { sidebar } from './src/site-navigation.mjs';
import { sitemapCompatibility } from './src/plugins/sitemap-compatibility.mjs';
import {
  pluginWorktrunkTerminal,
  rehypeComparisonCommands,
} from './src/plugins/worktrunk-terminal.mjs';
import {
  worktrunkDarkCodeTheme,
  worktrunkLightCodeTheme,
} from './src/themes/worktrunk-code.mjs';

const repository = 'https://github.com/max-sixty/worktrunk';
const site = 'https://worktrunk.dev';

export default defineConfig({
  site,
  devToolbar: {
    enabled: false,
  },
  markdown: {
    processor: unified({
      rehypePlugins: [
        rehypeStableHeadingIds,
        rehypePagefindCommandReferences,
        rehypeComparisonCommands,
        rehypeResponsiveTables,
      ],
    }),
  },
  integrations: [
    starlight({
      title: 'Worktrunk',
      description: 'Git worktree management for parallel AI agent workflows.',
      disable404Route: true,
      favicon: '/favicon.png',
      head: [
        // Restores the icon links the Zola site carried (#627); `favicon` above
        // emits only the 32x32 shortcut icon.
        {
          tag: 'link',
          attrs: { rel: 'icon', type: 'image/png', sizes: '48x48', href: '/favicon-48.png' },
        },
        {
          tag: 'link',
          attrs: { rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' },
        },
      ],
      logo: {
        src: './public/logo.png',
        alt: 'Worktrunk',
      },
      social: [
        { icon: 'github', label: 'GitHub', href: repository },
      ],
      tableOfContents: {
        minHeadingLevel: 1,
        maxHeadingLevel: 2,
      },
      editLink: {
        baseUrl: `${repository}/edit/main/docs/`,
      },
      customCss: ['./src/styles/custom.css'],
      components: {
        Footer: './src/components/Footer.astro',
        Head: './src/components/Head.astro',
        PageTitle: './src/components/PageTitle.astro',
        Pagination: './src/components/Pagination.astro',
        SocialIcons: './src/components/SocialIcons.astro',
        ThemeSelect: './src/components/ThemeSelect.astro',
      },
      expressiveCode: {
        // Shell examples render as plain code, without terminal window chrome.
        defaultProps: { frame: 'code' },
        plugins: [pluginWorktrunkTerminal()],
        themes: [worktrunkDarkCodeTheme, worktrunkLightCodeTheme],
        useStarlightUiThemeColors: true,
        styleOverrides: {
          borderRadius: '0',
          codeFontFamily: 'var(--sl-font-mono)',
          frames: {
            frameBoxShadowCssValue: 'none',
          },
        },
      },
      sidebar,
    }),
    sitemap({
      filter: (page) => ![`${site}/404/`, `${site}/worktrunk/`, `${site}/try-it/`].includes(page),
    }),
    sitemapCompatibility(),
  ],
});