0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00
astro/.changeset/long-lions-do.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
404 B
Markdown
Raw Normal View History

2024-09-05 09:58:23 -05:00
---
'astro': minor
---
Adds a new property `isPrerendered` to the globals `Astro` and `APIContext` . This boolean value represents whether or not the current page is prerendered:
```astro
---
// src/pages/index.astro
export const prerender = true
---
```
```js
// src/middleware.js
export const onRequest = (ctx, next) => {
2024-09-09 09:43:51 -05:00
console.log(ctx.isPrerendered) // it will log true
2024-09-05 09:58:23 -05:00
return next()
}
```