diff --git a/examples/astro-docs/README.md b/examples/astro-docs/README.md index 73d3be8..81511e0 100644 --- a/examples/astro-docs/README.md +++ b/examples/astro-docs/README.md @@ -21,6 +21,7 @@ npm run test:e2e --workspace=@inkform/example-astro-docs # Playwright: builds, - [`src/mdx-components.tsx`](./src/mdx-components.tsx) is the site's own MDX component (``), registered with the `components` option and styled by `src/styles/docs.css` through `customCss`. +- `credits: true` turns on the "Built with Inkform" line under each page. - [`e2e/docs.spec.ts`](./e2e/docs.spec.ts) checks that every page renders with no CSP violation, that tabs, code groups, accordions, the TOC, the theme toggle, the drawer, diagrams, the API sample pickers and Try It work, that diff --git a/examples/astro-docs/astro.config.ts b/examples/astro-docs/astro.config.ts index 4227497..eba3f8a 100644 --- a/examples/astro-docs/astro.config.ts +++ b/examples/astro-docs/astro.config.ts @@ -18,6 +18,8 @@ export default defineConfig({ // The site's own MDX components, and the CSS they use. components: './src/mdx-components.tsx', customCss: ['./src/styles/docs.css'], + // "Built with Inkform" under each page. Off unless a site turns it on. + credits: true, }), ], // This site has no Markdown pages of its own. Docs code blocks are diff --git a/examples/astro-docs/content/changelog/2026-10-01-v0-0-1.mdx b/examples/astro-docs/content/changelog/2026-10-01-v0-0-1.mdx index 581b33f..3d01b64 100644 --- a/examples/astro-docs/content/changelog/2026-10-01-v0-0-1.mdx +++ b/examples/astro-docs/content/changelog/2026-10-01-v0-0-1.mdx @@ -4,6 +4,8 @@ date: 2026-10-01 version: 0.0.1 --- +### Added + A route per `docs.json` page. ```ts diff --git a/examples/astro-docs/content/changelog/2026-10-23-v0-1-0.mdx b/examples/astro-docs/content/changelog/2026-10-23-v0-1-0.mdx index bb0f100..4d8a953 100644 --- a/examples/astro-docs/content/changelog/2026-10-23-v0-1-0.mdx +++ b/examples/astro-docs/content/changelog/2026-10-23-v0-1-0.mdx @@ -4,6 +4,12 @@ date: 2026-10-23 version: 0.1.0 --- +### Added + - Docs pages, the API Reference, blog and changelog under one base path. - Pagefind search, built after `astro build`. - `llms.txt` and `llms-full.txt`. + +### Changed + +- Rendered without React in the browser: tabs, code groups and search are small scripts. diff --git a/examples/astro-docs/e2e/docs.spec.ts b/examples/astro-docs/e2e/docs.spec.ts index 82a67b2..fc797fd 100644 --- a/examples/astro-docs/e2e/docs.spec.ts +++ b/examples/astro-docs/e2e/docs.spec.ts @@ -237,6 +237,30 @@ test.describe('components', () => { }); }); +test.describe('changelog', () => { + test('lists each version with its date, and every id on the page is unique', async ({ page }) => { + await page.goto('/docs/changelog'); + await expect(page.locator('.fw-changelog-title')).toHaveText(['The Astro integration', 'First sketch']); + await expect(page.locator('.fw-changelog-entry .fw-page-meta')).toHaveText(['2026-10-23 · v0.1.0', '2026-10-01 · v0.0.1']); + await expect(page.locator('.fw-toc-link')).toHaveText(['The Astro integration', 'First sketch']); + await expect(page.locator('.fw-toc-link').first()).toHaveAttribute('href', '#v0-1-0'); + // Both entries have an "Added" section; each keeps its own id. + await expect(page.locator('#v0-1-0-added')).toHaveText('Added'); + await expect(page.locator('#v0-0-1-added')).toHaveText('Added'); + const ids = await page.locator('[id]').evaluateAll((els) => els.map((el) => el.id)); + expect(ids.filter((id, i) => ids.indexOf(id) !== i)).toEqual([]); + }); +}); + +test.describe('credits', () => { + test('the "Built with Inkform" line links to the repository and stays out of search', async ({ page }) => { + await page.goto('/docs/quickstart'); + const credit = page.locator('main .fw-credits'); + await expect(credit.getByRole('link', { name: 'Built with Inkform' })).toHaveAttribute('href', 'https://github.com/inkform-dev/framework'); + await expect(credit).toHaveAttribute('data-pagefind-ignore', 'all'); + }); +}); + test.describe('API reference', () => { test('the sample picker and response tabs switch', async ({ page }) => { await page.goto('/docs/api-reference/operations/create-plant'); diff --git a/packages/astro/CHANGELOG.md b/packages/astro/CHANGELOG.md index e20f507..d325c79 100644 --- a/packages/astro/CHANGELOG.md +++ b/packages/astro/CHANGELOG.md @@ -7,6 +7,11 @@ Versions track `packages/astro/package.json`. Format loosely follows ### Fixed +- Headings inside changelog entries no longer share ids across entries: each + entry's heading and footnote ids are scoped to it (`#v0-2-0-added`), and + two entries whose files share a name get distinct anchors. A `version` + written with its `v` (`v1.2.0`) no longer shows as `vv1.2.0`, and the date + is a `