Skip to content

fix(astro): Astro's base in every link, llms.txt trailing slashes, phone header - #29

Merged
CharanMN7 merged 2 commits into
mainfrom
fix/astro-base-components-mobile
Oct 27, 2026
Merged

CharanMN7 merged 2 commits into
mainfrom
fix/astro-base-components-mobile

Conversation

@CharanMN7

@CharanMN7 CharanMN7 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes three gaps hit while running @inkform/astro 0.1.0 for a GitHub Pages project site (base: '/ig-comment-dm/', trailingSlash: 'always'). That site needed a post-build integration to rewrite links and theme overrides for the header. Neither is needed after this.

Astro's base in every link

  • One rewriter (siteHrefRewriter) now handles every site-root href, from docs.json (navbarLinks, anchors, cta, sidebar entries with an href) or from MDX:
    • a docs page goes through the docs linker, which adds the base, publicBase and the trailing slash;
    • anything else (/, /pricing, /shots/a.png) gets Astro's base, the way next/link adds basePath. Images already worked this way.
  • Links already under the base are left alone, so sites that typed the base out by hand keep working.
  • MDX links written with the docs base (/docs/quickstart) are recognised as docs pages. They get publicBase and the trailing slash too.
  • Sidebar, breadcrumbs, prev/next and search results already respected the base. Tests now cover all of them under /sub with trailingSlash: 'always'.

llms.txt

  • The index is built from the route table with the same linker the pages use (runtime/llms.ts), in the framework's format. Links now follow trailingSlash.
  • For a spec without operationIds, the operation links now match the URLs the site serves. The framework's builder names those operations differently.
  • With the default config the output is unchanged, and the existing e2e assertions still pass.

Phone header (verified at 375px)

  • On screens 40rem and under, the single-row header kept the logo, the tab row, search with its ⌘K hint and the toggle in one row. With a non-galley theme it was 389px wide at 375px, the tab row shrank to nothing and the toggle was cut off.
  • Now, on those screens:
    • the tab row moves to the drawer, which already lists the same links. Galley keeps its own tab row.
    • the shortcut hint is hidden;
    • a long site name gets an ellipsis.
  • Stacked API operation pages were 389px wide too, because the column grew to the longest code sample. The column is now minmax(0, 1fr).

Uppercase labels

  • The sidebar group names and the "On this page" title are uppercase on purpose. The Next.js themes share that style and galley drops it for the sidebar.
  • They stay uppercase by default. Three documented variables now change them without restating the rules: --fw-label-transform, --fw-label-letter-spacing and --fw-label-font-size.

Unreleased CHANGELOG entries are added. No version bump. The 0.1.0 heading gets its publish date.

Also: npm audit

CI's npm audit --audit-level=high gate started failing on advisories published after the last green main run. Those advisories aren't from this change, so the fix is a separate fix(deps) commit, lockfile only. It bumps body-parser to 2.4.0, undici to 7.30.1, qs to 6.17.0 and fast-uri to 3.1.9.

Test plan

  • npm audit --audit-level=high: 0 vulnerabilities.
  • npm test: framework 124 and astro 66 pass. New tests cover siteHrefRewriter, nav under a base, llmsIndex and pageUrl with a base.
  • npm run typecheck for @inkform/astro and the example: 0 errors.
  • npm run test:e2e --workspace=@inkform/example-astro-docs: 35 pass, including a new test for no sideways scroll at 375px on doc, API, and changelog pages.
  • I built the example with base: '/sub' and trailingSlash: 'always' using a local config that isn't committed.
    • Every href/src in the built docs starts with /sub/, and the CTA / is now /sub/.
    • Every llms.txt link ends in /.
    • Header width at 375px went from 389 to 375 with the plain theme. With galley it stays at 375, and a long site name truncates.

🤖 Generated with Claude Code

https://claude.ai/code/session_011YQ6fJxGHg3CxGkTzw6Yhc

Sites served under Astro's `base` (GitHub Pages project sites) got broken
links for anything Inkform printed from docs.json or MDX that wasn't a docs
page: the navbar's `/` went to the domain root. Every site-root href now goes
through one rewriter: docs pages through the docs linker (base, publicBase,
trailing slash), anything else gets Astro's base, as images already did.
Links already under the base are left alone, so hand-written workarounds keep
working. Links written with the docs base (`/docs/x`) count as docs pages.

llms.txt is built from the route table with the same linker, so its links
follow `trailingSlash` and match the operation URLs the site serves.

On screens 40rem and under the single-row header keeps to the screen: the tab
row moves to the drawer (galley keeps its own row), the shortcut hint is
hidden and a long site name gets an ellipsis. Stacked API operation pages no
longer widen to their longest code sample. The sidebar group and TOC title
labels read three CSS variables, so a theme can drop the uppercase without
restating the rules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YQ6fJxGHg3CxGkTzw6Yhc
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
framework-inkform-docs Ready Ready Preview Oct 27, 2026 8:41am UTC
pokeapi Ready Ready Preview Oct 27, 2026 8:41am UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – pokeapi October 27, 2026 08:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – framework-inkform-docs October 27, 2026 08:32 Inactive
CI's npm audit --audit-level=high gate started failing on advisories published
after the last green main run (23 Oct). Lockfile only, via npm audit fix:
- body-parser 2.3.0 -> 2.4.0 (high GHSA-27r3-jxmh-p828), with qs 6.16.0 -> 6.17.0
- undici 7.30.0 -> 7.30.1 (high GHSA-4qv8-2p9j-2685, GHSA-f72v-6w45-q472,
  GHSA-xjj6-f33q-929c)
- fast-uri 3.1.8 -> 3.1.9 (four moderate advisories)

npm audit now reports 0 vulnerabilities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YQ6fJxGHg3CxGkTzw6Yhc

This branch was successfully deployed

2 active deployments
Preview – framework-inkform-docs — cd39fabc Deployed Oct 27, 2026 by vercel[bot]
Preview – pokeapi — cd39fabc Deployed Oct 27, 2026 by vercel[bot]
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.

1 participant