mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
22 lines
404 B
Markdown
22 lines
404 B
Markdown
---
|
|
'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) => {
|
|
console.log(ctx.isPrerendered) // it will log true
|
|
return next()
|
|
}
|
|
```
|