@parhelia/astro
v1.0.12951
Published
The Astro adapter of @parhelia/head for a rendering head written in Astro, with or without React: the integration (base path below Parhelia's rendering proxy, the build values inlined) and ParheliaSlot, ParheliaBridge and ParheliaRefresh as Astro componen
Readme
@parhelia/astro
The Astro adapter of @parhelia/head, for a rendering head written in Astro, with or without React:
the integration and the slot, bridge and refresh components. Everything else (the server check @parhelia/head/server, the
rendered identity, rich text, a CMS's markers) is @parhelia/head's, as for every head.
// astro.config.mjs
import node from '@astrojs/node';
import parhelia from '@parhelia/astro';
export default defineConfig({ output: 'server', adapter: node({ mode: 'standalone' }), integrations: [parhelia()] });---
import ParheliaSlot from '@parhelia/astro/ParheliaSlot.astro';
import ParheliaRefresh from '@parhelia/astro/ParheliaRefresh.astro';
import ParheliaBridge from '@parhelia/astro/ParheliaBridge.astro';
---
<ParheliaRefresh signature={signature}>
<ParheliaSlot name="main" enabled={edit}>{blocks}</ParheliaSlot>
</ParheliaRefresh>
<ParheliaBridge />parhelia() sets Astro's base to the rendering proxy's path and inlines the build values. ParheliaRefresh reads the page
again on window.requestRefresh and updates it in place (Astro has no client router doing it), until the signature
changed. Render the refresh and the bridge in editing renders only.
ParheliaRefresh patches what changed into the live document (installParheliaDomRefresh of @parhelia/head), so an inline
edit in progress survives a refresh.
