Skip to content

Cross-Site Linking Convention

This page documents the bi-directional linking convention between the Documentation site (Astro/Starlight) and the UX Prototype site (Storybook).

Arda maintains two complementary documentation sites:

SiteTechnologyPurposeDeployment
DocumentationAstro + StarlightSource of truth for product requirements, use case specifications, personas, and domain knowledgearda-cards.github.io/documentation
UX PrototypeStorybook + ReactInteractive prototypes demonstrating use cases with step-by-step storiesarda-cards.github.io/ux-prototype

The Documentation site is the canonical source for specification content. The UX Prototype site provides interactive demonstrations that reference back to the specifications.

Documentation pages that have a corresponding Storybook prototype can declare a downstream-tracking field in their YAML frontmatter:

downstream-tracking:
type: storybook
path: "?path=/docs/use-cases-procurement-purchase-orders--docs"

When present, the site automatically renders a link to the prototype at the top of the page content. No manual component import is needed.

The field is an object with three properties:

  • type (required): One of storybook, docs, or github-issue.
  • path (required): The URL path appended to the base URL for that type.
  • label (optional): Overrides the default link text.
TypeDev Base URLProduction Base URLDefault LabelLink Target
storybookhttp://localhost:6006https://arda-cards.github.io/ux-prototype”View Interactive Prototype”_blank
docsrelative (same site)relative (same site)“View Related Documentation”_self
github-issuehttps://github.com/https://github.com/”View GitHub Issue”_blank

The Storybook base URL can be overridden with the PUBLIC_STORYBOOK_URL environment variable.

Storybook generates URL slugs from <Meta title="..." /> declarations. The convention is:

  1. Take the Meta title (e.g., Use Cases/Procurement/Purchase Orders)
  2. Lowercase everything
  3. Replace / with -
  4. Replace spaces with -
  5. Append --docs

Result: ?path=/docs/use-cases-procurement-purchase-orders--docs

The UX Prototype site uses a docsUrl() helper function to generate links back to the Documentation site:

import { docsUrl } from '../links';
// In MDX:
<a href={docsUrl('/product/use-cases/procurement/purchase-orders/')}
target="_blank" rel="noopener">
View full specification &#8594;
</a>

The helper resolves URLs based on the build environment:

EnvironmentBase URL
Development (import.meta.env.DEV)http://localhost:4321
Productionhttps://arda-cards.github.io/documentation

Documentation paths follow the Starlight content collection structure. The convention maps from file paths:

  1. Start from src/content/docs/
  2. The file path becomes the URL path (e.g., product/use-cases/procurement/purchase-orders.md becomes /product/use-cases/procurement/purchase-orders/)
  3. Always include the trailing slash

To test cross-site links locally, run both dev servers:

Terminal window
# Terminal 1 — Documentation (port 4321)
cd documentation && npx astro dev
# Terminal 2 — UX Prototype (port 6006)
cd ux-prototype && npm run storybook

Documentation pages with downstream-tracking will link to localhost:6006. Storybook thin reference pages will link to localhost:4321.