Skip to content

feat(docs): add dab config and docs path#33

Open
janelletam wants to merge 19 commits into
masterfrom
janelle/docs-v2/add-docs-path
Open

feat(docs): add dab config and docs path#33
janelletam wants to merge 19 commits into
masterfrom
janelle/docs-v2/add-docs-path

Conversation

@janelletam

@janelletam janelletam commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Add dab config to docs-v2.foundation.botpress.cloud & docs-v2.foundation.botpress.cloud.dev. Update base path to use docs to match botpress.com/docs

image

@greptile-apps

greptile-apps Bot commented Jun 8, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a dab deployment config pointing to docs-v2.foundation.botpress.cloud/.dev and corrects the Astro base path by splitting site (https://botpress.com) from base (/docs) so the site is served at botpress.com/docs.

  • All hardcoded asset paths and internal links across components, layouts, and site-config have been updated to include the /docs prefix.
  • New withBase/stripBase helpers are added to src/bach/utils.ts to centralise path construction for the sidebar tree, though the backing constant BASE_PREFIX remains a manual copy of the Astro config value.
  • pnpm-workspace.yaml is introduced to allow native-build packages that come in as transitive deps of @botpress-private/dab.

Confidence Score: 4/5

The change is mechanical and self-consistent — all internal links and static asset paths have been updated to match the new /docs base. The two minor concerns do not affect runtime behaviour.

The path updates across components and the withBase/stripBase helpers are correct and consistent. The BASE_PREFIX constant is a separate source of truth from astro.config.mjs, which could drift if the base path ever changes again.

src/bach/utils.ts (BASE_PREFIX sync), dab.config.ts (import ordering)

Important Files Changed

Filename Overview
astro.config.mjs Correctly splits site and base to align Astro's URL generation with botpress.com/docs.
dab.config.ts New dab deployment config targeting docs-v2.foundation.botpress.cloud/.dev; import ordering is inverted (import after export).
src/bach/utils.ts Adds withBase/stripBase helpers and BASE_PREFIX; constant must be manually kept in sync with astro.config.mjs.
src/lib/site-config.ts Logo paths updated to include /docs prefix, consistent with the new base path.
src/layouts/BaseLayout.astro Favicon and sitemap link hrefs correctly updated to /docs/ prefix.
src/components/HomePage.astro All card hrefs and image paths updated to /docs/ prefix — correct for the new base.
src/components/header.tsx Logo home link updated from / to /docs/.
src/components/mobile-sidebar.tsx Mobile logo home link updated to /docs/, consistent with desktop header change.
src/components/SearchButton.tsx Icon image path updated to /docs/homepage-assets/ prefix.
pnpm-workspace.yaml New file allowing builds for packages that are transitive deps of @botpress-private/dab.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Request to botpress.com/docs/*"] --> B["Astro static site\nsite: 'https://botpress.com'\nbase: '/docs'"]
    B --> C{Path type}
    C -->|"Internal nav link"| D["Hardcoded in\nHomePage.astro / header.tsx\n/ mobile-sidebar.tsx"]
    C -->|"Sidebar link"| E["withBase() in utils.ts\nBASE_PREFIX = '/docs'"]
    C -->|"Static asset"| F["Hardcoded /docs/ prefix\nin site-config.ts /\nBaseLayout.astro /\nSearchButton.tsx"]
    E --> G["Rendered href: /docs/path"]
    D --> G
    F --> H["Served from public/ under /docs/ base"]
    G --> I["User navigates correctly within /docs/*"]
    H --> I
Loading

Reviews (1): Last reviewed commit: "feat(docs): add dab config and docs path" | Re-trigger Greptile

Comment thread dab.config.ts Outdated
Comment thread src/bach/utils.ts Outdated
Comment on lines +58 to +59
/** URL prefix matching Astro's `base` config — must stay in sync with astro.config.mjs. */
export const BASE_PREFIX = '/docs'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Dual source of truth for the base path

BASE_PREFIX is hardcoded to '/docs' with a manual sync requirement against astro.config.mjs. Astro/Vite exposes import.meta.env.BASE_URL at build time (e.g. /docs/), which always reflects whatever base is in astro.config.mjs — eliminating the risk of the two drifting apart. Consider deriving BASE_PREFIX from it instead: const BASE_PREFIX = import.meta.env.BASE_URL.replace(/\/$/, '').

Comment thread src/bach/utils.ts
}

/** URL prefix derived from Astro's `base` config (e.g. `/docs`). Empty when base is `/`. */
export const BASE_PREFIX = import.meta.env.BASE_URL.replace(/\/$/, '')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo (non-blocking): bach shouldn't read from the environment. BASE_URL is set by astro, we should pass the BASE_URL through some input to bach. We use the bach Site class to pass input from astro to bach. We should move these utils onto the site and pass in the BASE_URL to the Site constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants