Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/heavy-eagles-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro-vtbot': patch
---

Fixes an issue, where the starlight plugin stopped to work on Starlight 0.33.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ A current deployment of tech demos and the documentation can be found at https:/

## !!! NEW TRICKS ✨ IN THE BAG 👜 !!!

> Fixed a race condition where the Inspection-Chamber couldn't properly hook in.
> The Starlight plugin that adds view transitions to a Starlight site was broken starting from Starlight version 0.33.0.
This is fixed now.

## Recently Learned Tricks ##

> Fixed a race condition where the Inspection-Chamber couldn't properly hook in.

> Stabilization and adaption to new Astro version, see [CHANGELOG](https://github.com/martrapp/astro-vtbot/blob/main/CHANGELOG.md).

> Hello Astronauts! Now this one is BIG! The `astro-vtbot` has been many things so far. Now it is also a **Starlight plugin**!
Expand All @@ -29,8 +32,6 @@ A current deployment of tech demos and the documentation can be found at https:/

> The existing Starlight support was updated for Starlight versions >= 0.32!

> The integration setup can now also find the `astro-inspection-chamber.js.ts` file when used in monorepos with `pnpm`. \
Big shout out and "Thank You!" to [Luísa](https://github.com/luisaverza) for providing this fix!

**Version 2.0.0 🎉 of astro-vtbot is here!**

Expand All @@ -44,6 +45,9 @@ For details, see the [CHANGELOG](https://github.com/martrapp/astro-vtbot/blob/ma
For further information see these demos: [blog demo](http://events-3bg.pages.dev/signal-demo/link-types/blog/), [@vtbag image viewer demo](https://vtbag.dev/viewer-demo/) and the [@vtbag fishpond demo](https://vtbag.dev/link-demo/).


> The integration setup can now also find the `astro-inspection-chamber.js.ts` file when used in monorepos with `pnpm`. \
Big shout out and "Thank You!" to [Luísa](https://github.com/luisaverza) for providing this fix!

> The Inspection Chamber DevTools now also work for `pnpm` projects! \
Big shout out and "Thank You!" to [Lukas](https://github.com/Trombach) for providing this fix!

Expand Down
8 changes: 4 additions & 4 deletions integration/starlight-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ export const onRequest = defineRouteMiddleware((context) => {
const directionAttribute = process.env.vtbagDirectionAttribute;
const camShaftNames = process.env.vtbagCamShaftNames;
const data = context.locals.starlightRoute.entry.data;
const head = data.head ?? [];
const head = context.locals.starlightRoute.head ?? data.head;
if (!expect(data.renderBlocking, head)) {
// might be set by remarkEndOfMarkdownId
expect(process.env.vtbotEndOfContentId, head);
}
{
const attrs = { src: shaft, async: true, blocking: 'render' };
camShaftNames ?? (attrs['data-view-transition-names'] = camShaftNames);
head.push({ tag: 'script', attrs });
head.push({ tag: 'script', attrs, content: '' });
}
{
const attrs = { src: signal, async: true, blocking: 'render' };
allPages === undefined || (attrs['data-selector'] = allPages);
directionTypes === undefined || (attrs['data-direction-types'] = directionTypes);
directionAttribute === undefined || (attrs['data-direction-attribute'] = directionAttribute);
head.push({ tag: 'script', attrs });
head.push({ tag: 'script', attrs, content: '' });
}
{
const attrs = {
Expand All @@ -35,7 +35,7 @@ export const onRequest = defineRouteMiddleware((context) => {
blocking: 'render',
'data-vtbag-decl': declarativeNames,
};
declarativeNames && head.push({ tag: 'script', attrs });
declarativeNames && head.push({ tag: 'script', attrs, content: '' });
}
});

Expand Down
Loading
Loading