0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00
astro/.changeset/brave-pots-drop.md
Matthew Phillips fe4079f05b
Partials (#8755)
* Fragment support

* Add a changeset

* Linting

* debuggin

* Rename to partial

* Update the chagneset

* Make work with mdx

* Update .changeset/brave-pots-drop.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/brave-pots-drop.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update .changeset/brave-pots-drop.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-10-26 10:14:10 -04:00

810 B

astro
minor

Page Partials

A page component can now be identified as a partial page, which will render its HTML content without including a <! DOCTYPE html> declaration nor any <head> content.

A rendering library, like htmx or Stimulus or even just jQuery can access partial content on the client to dynamically update only parts of a page.

Pages marked as partials do not have a doctype or any head content included in the rendered result. You can mark any page as a partial by setting this option:

---
export const partial = true;
---

<li>This is a single list item.</li>

Other valid page files that can export a value (e.g. .mdx) can also be marked as partials.

Read more about Astro page partials in our documentation.