# External References Configuration
# ==================================
# Enables cross-project documentation linking via [[ext:project:target]] syntax.
# See: plan/rfc-external-references.md

external_refs:
  enabled: true

  # Export xref.json for other sites to consume
  # This generates /xref.json with all pages, classes, functions indexed
  export_index: true

  # Cache directory for fetched indexes from other Bengal sites
  cache_dir: ".bengal/cache/external_refs"
  default_cache_days: 7

  # URL templates for instant, offline resolution
  # These work without network access and are the primary resolution method
  templates:
    # Python standard library
    python: "https://docs.python.org/3/library/{module}.html#{name}"
    typing: "https://docs.python.org/3/library/typing.html#{name}"

    # Popular libraries
    requests: "https://requests.readthedocs.io/en/latest/api/#{name}"
    httpx: "https://www.python-httpx.org/api/#{name_lower}"
    pydantic: "https://docs.pydantic.dev/latest/api/{module}/#{name}"

    # Bengal ecosystem - URL templates for immediate resolution
    # These work now, before xref.json is deployed
    # Note: {target} is empty for homepage links like [[ext:kida:|Kida]],
    # so we omit trailing slash to avoid double-slash URLs
    kida: "https://lbliii.github.io/kida/{target}"
    patitas: "https://lbliii.github.io/patitas/{target}"
    rosettes: "https://lbliii.github.io/rosettes/{target}"

  # Bengal ecosystem indexes (for richer metadata when sites are deployed)
  # During local development, use relative paths to sibling project output
  indexes:
    # Kida template engine
    # - Production: "https://lbliii.github.io/kida/xref.json"
    # - Local dev: Use relative path to built site
    - name: kida
      url: "../../../kida/public/xref.json"
      cache_days: 7

    # Rosettes syntax highlighting
    # - Production: "https://lbliii.github.io/rosettes/xref.json"
    # - Local dev: Use relative path to built site
    - name: rosettes
      url: "../../../rosettes/public/xref.json"
      cache_days: 7
