{"_id":"@dagilleland/starlight-plugin-layouts","_rev":"4-1915c5ecff69b5e86ddbceac9abd432d","name":"@dagilleland/starlight-plugin-layouts","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@dagilleland/starlight-plugin-layouts","version":"0.1.0","keywords":["astro","astro-component","astro-integration","starlight","starlight-plugin","starlight-layouts","layout"],"author":{"name":"Dan Gilleland"},"license":"MIT","_id":"@dagilleland/starlight-plugin-layouts@0.1.0","maintainers":[{"name":"dagilleland","email":"dagilleland@shaw.ca"}],"homepage":"https://gilleland.ca/starlight-layouts/tutorial/starlight-plugin/","bugs":{"url":"https://github.com/dagilleland/starlight-layouts/issues"},"dist":{"shasum":"f71100da9d3ae45819a9d80632e0796b0e22816b","tarball":"https://registry.npmjs.org/@dagilleland/starlight-plugin-layouts/-/starlight-plugin-layouts-0.1.0.tgz","fileCount":11,"integrity":"sha512-o4nDl+Ty3Rpmffx3myEDJxAoz3CMDN+MLXizYGTUZeKz9D/TqVUqTr+btOSkscdIRsedOKVGJll7++gfhGzcwQ==","signatures":[{"sig":"MEQCICv8p1l2hNgh5ke/pmzfZfD5BENURVTxepdNCrii2GsGAiBQCYeyAmZoE3zFIaNgqNHLc17X/V01UD9Wu4I+bh4upA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16262},"type":"module","exports":{".":"./index.ts","./*":"./*","./meta":"./layouts.meta.ts"},"gitHead":"f609269290c652a57b3b3196369f65be2be92b21","_npmUser":{"name":"dagilleland","email":"dagilleland@shaw.ca"},"repository":{"url":"git+https://github.com/dagilleland/starlight-layouts.git","type":"git","directory":"packages/starlight-plugin-layouts"},"_npmVersion":"11.18.0","description":"Starlight plugin that bundles all four Starlight Layouts packages and registers their component overrides automatically — no override files to create.","directories":{},"_nodeVersion":"24.13.1","dependencies":{"@dagilleland/layout-minimal":"workspace:*","@dagilleland/layout-dashboard":"workspace:*","@dagilleland/layout-full-width":"workspace:*","@dagilleland/layout-with-aside":"workspace:*"},"_hasShrinkwrap":false,"peerDependencies":{"astro":"^7.0.2"},"_npmOperationalInternal":{"tmp":"tmp/starlight-plugin-layouts_0.1.0_1784201557208_0.9564710696703074","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dagilleland/starlight-plugin-layouts","version":"0.1.1","keywords":["astro","astro-component","astro-integration","starlight","starlight-plugin","starlight-layouts","layout"],"author":{"name":"Dan Gilleland"},"license":"MIT","_id":"@dagilleland/starlight-plugin-layouts@0.1.1","maintainers":[{"name":"dagilleland","email":"dagilleland@shaw.ca"}],"homepage":"https://gilleland.ca/starlight-layouts/tutorial/starlight-plugin/","bugs":{"url":"https://github.com/dagilleland/starlight-layouts/issues"},"dist":{"shasum":"dd9a0395d5e06519ebb017ddaa2c9763d64df64c","tarball":"https://registry.npmjs.org/@dagilleland/starlight-plugin-layouts/-/starlight-plugin-layouts-0.1.1.tgz","fileCount":11,"integrity":"sha512-LdIkBNDgvNgEcqyFcE1aPwuUEkD5Ar+uErrurjwrYRFCwof0BbdgmJq+OBztOYqm2KImVAVlw3HoKxhPLRRWSw==","signatures":[{"sig":"MEUCIFPKEm5NfokPcNTxRnSpgoqTpnZK/mVQML/IS3jCU5AuAiEAjdVhNBGpVlkv/5d4RfTxIZymS5MtD/hTuhuTfL0UJSM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16670},"type":"module","exports":{".":"./index.ts","./*":"./*","./meta":"./layouts.meta.ts"},"gitHead":"8fcdb26b5e2357a72b030f031104f0341fe8de66","_npmUser":{"name":"dagilleland","email":"dagilleland@shaw.ca"},"repository":{"url":"git+https://github.com/dagilleland/starlight-layouts.git","type":"git","directory":"packages/starlight-plugin-layouts"},"_npmVersion":"11.18.0","description":"Starlight plugin that bundles all four Starlight Layouts packages and registers their component overrides automatically — no override files to create.","directories":{},"_nodeVersion":"24.13.1","dependencies":{"@dagilleland/layout-minimal":"workspace:*","@dagilleland/layout-dashboard":"workspace:*","@dagilleland/layout-full-width":"workspace:*","@dagilleland/layout-with-aside":"workspace:*"},"_hasShrinkwrap":false,"peerDependencies":{"astro":"^6.4.5 || ^7.0.2","@astrojs/starlight":">=0.40.0 <0.42.0"},"_npmOperationalInternal":{"tmp":"tmp/starlight-plugin-layouts_0.1.1_1784203173950_0.5307280426479528","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Broken workspace:* dependency on the four layout packages under non-pnpm package managers - upgrade to 0.1.2 or later"},"0.1.2":{"name":"@dagilleland/starlight-plugin-layouts","version":"0.1.2","keywords":["astro","astro-component","astro-integration","starlight","starlight-plugin","starlight-layouts","layout"],"author":{"name":"Dan Gilleland"},"license":"MIT","_id":"@dagilleland/starlight-plugin-layouts@0.1.2","maintainers":[{"name":"dagilleland","email":"dagilleland@shaw.ca"}],"homepage":"https://gilleland.ca/starlight-layouts/tutorial/starlight-plugin/","bugs":{"url":"https://github.com/dagilleland/starlight-layouts/issues"},"dist":{"shasum":"d6523b48edcb67bd4d0d0da4f7329d84ef7bf912","tarball":"https://registry.npmjs.org/@dagilleland/starlight-plugin-layouts/-/starlight-plugin-layouts-0.1.2.tgz","fileCount":12,"integrity":"sha512-SXVzcqHG2tpL5n/TMJ6h1+C+rBDZb0JNDYNVwPwuUNp6cthwqfwHiAeQbEgmUgc5I6sdRXVToAY9xLWu4XfBGA==","signatures":[{"sig":"MEYCIQDv/js4I1qG6IUWH5Qo5pEWefewsdDSLyq0o7+ImUsNEgIhAO2vDsz3rxPQ2dGwG3cQylNNYkwboY+5NvdsQQqOW0r5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":17894},"type":"module","exports":{".":"./index.ts","./*":"./*","./meta":"./layouts.meta.ts"},"gitHead":"aa42ca69fc38b570685de08655cec1d765faf63e","_npmUser":{"name":"dagilleland","email":"dagilleland@shaw.ca"},"repository":{"url":"git+https://github.com/dagilleland/starlight-layouts.git","type":"git","directory":"packages/starlight-plugin-layouts"},"_npmVersion":"11.18.0","description":"Starlight plugin that bundles all four Starlight Layouts packages and registers their component overrides automatically — no override files to create.","directories":{},"_nodeVersion":"24.13.1","dependencies":{"@dagilleland/layout-minimal":"0.1.1","@dagilleland/layout-dashboard":"0.1.1","@dagilleland/layout-full-width":"0.1.1","@dagilleland/layout-with-aside":"0.1.1"},"_hasShrinkwrap":false,"peerDependencies":{"astro":"^6.4.5 || ^7.0.2","@astrojs/starlight":">=0.40.0 <0.42.0"},"_npmOperationalInternal":{"tmp":"tmp/starlight-plugin-layouts_0.1.2_1784204279474_0.9624476668476052","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-07-16T11:32:37.118Z","modified":"2026-07-16T12:18:23.658Z","0.1.0":"2026-07-16T11:32:37.346Z","0.1.1":"2026-07-16T11:59:34.097Z","0.1.2":"2026-07-16T12:17:59.616Z"},"bugs":{"url":"https://github.com/dagilleland/starlight-layouts/issues"},"author":{"name":"Dan Gilleland"},"license":"MIT","homepage":"https://gilleland.ca/starlight-layouts/tutorial/starlight-plugin/","keywords":["astro","astro-component","astro-integration","starlight","starlight-plugin","starlight-layouts","layout"],"repository":{"url":"git+https://github.com/dagilleland/starlight-layouts.git","type":"git","directory":"packages/starlight-plugin-layouts"},"description":"Starlight plugin that bundles all four Starlight Layouts packages and registers their component overrides automatically — no override files to create.","maintainers":[{"name":"dagilleland","email":"dagilleland@shaw.ca"}],"readme":"# `@dagilleland/starlight-plugin-layouts`\n\nPart of [Starlight Layouts](https://gilleland.ca/starlight-layouts/) — a tutorial site for overriding Starlight components to build custom page layouts. This package bundles all four layouts (`@dagilleland/layout-full-width`, `layout-minimal`, `layout-with-aside`, `layout-dashboard`) as a single Starlight plugin, so installing it wires up all four dispatcher overrides automatically — no override files to create by hand.\n\n## Compatibility\n\nWorks with **Astro 6.4.5+ or 7.x**, and **Starlight 0.40.0–0.41.x** — enforced by this package's own `peerDependencies`, and confirmed by actually building and rendering a test project against both ends of that range (Astro 6.4.8/Starlight 0.40.0, and Astro 7.0.9/Starlight 0.41.3), not just inferred from the declared versions.\n\n## What's here\n\n- `layouts.meta.ts` / `layouts.config.ts` — the same registry pattern as the tutorial site's own `apps/site/src/layouts.config.ts`, importing all four layout packages by their published names.\n- `overrides/{PageFrame,TwoColumnContent,PageSidebar,ContentPanel}.astro` — the four dispatcher components, identical to the tutorial site's own `apps/site/src/components/overrides/*.astro`.\n- `tailwind.css` — aggregates all four layout packages' own `tailwind.css` files into one `@import`.\n- `index.ts` — the plugin itself: a `starlightLayouts()` factory returning a `StarlightPlugin` that registers the four overrides via `updateConfig`, plus a re-exported `layoutIds`/`LayoutId` for building your own content-schema field from the same source of truth.\n\nWhy one plugin instead of four independent ones: `full-width`, `minimal`, and `dashboard` all share the `TwoColumnContent`/`ContentPanel` slots via a `wide` trait. Starlight applies each plugin's `updateConfig({ components: {...} })` call as a whole-object replacement, not a per-key merge — so two independent plugins both touching the same slot would have the second one silently clobber the first's registration. One plugin owning the whole family avoids that collision entirely. See [Turning it into a Starlight plugin](https://gilleland.ca/starlight-layouts/tutorial/starlight-plugin/) for the full reasoning.\n\n## Using this in a pnpm workspace monorepo\n\nThis package isn't used by the tutorial site itself — `apps/site` keeps its own hand-written dispatcher files, since that's what the tutorial is teaching. This package exists as the *packaged* version of that same pattern, for someone who wants the four layouts working with the least possible setup rather than following along with how the override mechanism works.\n\n## Using this standalone, in your own project\n\n**Prerequisites:** an Astro project using [Starlight](https://starlight.astro.build), with [Tailwind v4 set up per Starlight's own guide](https://starlight.astro.build/guides/css-and-tailwind/) — `layout-with-aside` and `layout-dashboard`'s components are styled with Tailwind utility classes.\n\n### 1. Install the package\n\n```sh\nnpm install @dagilleland/starlight-plugin-layouts\n```\n\nWorks the same with `pnpm add`, `yarn add`, or `bun add`. This installs the plugin and all four layout packages together — you don't need to also `npm install` each one separately.\n\n### 2. Register the plugin\n\n```js title=\"astro.config.mjs\"\nimport starlight from '@astrojs/starlight';\nimport starlightLayouts from '@dagilleland/starlight-plugin-layouts';\n\nstarlight({\n  plugins: [starlightLayouts()],\n});\n```\n\nThis registers `PageFrame`, `TwoColumnContent`, `PageSidebar`, and `ContentPanel` for you. Don't also set any of those four directly in your own `components:` config, or combine this with another plugin that touches the same slots — whichever runs last wins, silently.\n\n### 3. Add a frontmatter field\n\nA Starlight plugin can't extend the content-collection schema — this step stays manual, but `layoutIds` keeps it to one line instead of retyping four layout names:\n\n```ts title=\"src/content.config.ts\"\nimport { defineCollection, z } from 'astro:content';\nimport { docsLoader } from '@astrojs/starlight/loaders';\nimport { docsSchema } from '@astrojs/starlight/schema';\nimport { layoutIds } from '@dagilleland/starlight-plugin-layouts/meta';\n\nexport const collections = {\n  docs: defineCollection({\n    loader: docsLoader(),\n    schema: docsSchema({\n      extend: () =>\n        z.object({\n          pageLayout: z.enum(layoutIds).optional(),\n        }),\n    }),\n  }),\n};\n```\n\n### 4. Import the bundled Tailwind styles\n\nAlso stays manual, for the same reason: Tailwind v4 only scans `@source` directives that live in the same CSS module graph as wherever `tailwindcss` itself is imported, and a plugin's `customCss` entries are a separate, disconnected graph — registering this automatically doesn't work (confirmed by building it both ways and diffing the compiled CSS). One `@import` covers all four layouts:\n\n```css title=\"src/styles/global.css\"\n@import '@dagilleland/starlight-plugin-layouts/tailwind.css';\n```\n\n### 5. Use a layout on a page\n\n```md title=\"src/content/docs/some-page.md\"\n---\ntitle: A wide page\npageLayout: full-width\n---\n```\n\nAny of the four layout IDs work here: `full-width`, `minimal`, `with-aside`, `dashboard`. Pages without `pageLayout` set fall straight through to Starlight's own default rendering, same as if you'd wired up each layout package by hand.\n\n## Want just one or two layouts instead of all four?\n\nThis plugin is all-or-nothing by design — it's meant to replace the full manual wiring, not a subset of it. For a single layout, or to see the override code you're actually installing, use that layout's own package directly and follow its README, or the corresponding [wire-up page](https://gilleland.ca/starlight-layouts/install/wire-full-width/) on the tutorial site.\n","readmeFilename":"README.md"}