Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

MoustaphaDev/astro-default-prerender

Repository files navigation

Astro Default Prerender 🚀

Prerender all your Astro pages by default

astro-default-prerender licence astro-default-prerender issues astro-default-prerender pull-requests astro-default-prerender stars astro-default-prerender total downloads

View Demo · Report Bug

Table of contents

Why astro-default-prerender?

Astro's prerendering is a great feature that allows you to mix static and dynamic pages. However, it can be a bit tedious to add export const prerender = true to your pages, especially if you have a lot of static pages and only a few dynamic ones.

astro-default-prerender is an Astro integration that allows you to opt-out of prerendering instead of opting-in. This means that all your pages will be prerendered by default, unless you explicitly set export const prerender = false on a page.

Many Thanks to all the Stargazers

Stargazers repo roster for astro-default-prerender

🚀 Demo

Try out the minimal demo.

Open in StackBlitz

💻 Quickstart

Before you get started set the output target to server and have an adapter wired up. You can learn more about this in the Astro docs.

Now that you're all set up, you can install astro-default-prerender with the astro add CLI tool

# Using NPM
npx astro add astro-default-prerender

# Using YARN
yarn astro add astro-default-prerender

# Using PNPM
pnpm astro add astro-default-prerender

That's it! Now all your pages will be prerendered by default. You can still override this by adding export const prerender = false to your pages.

🛡️ License

This project is licensed under the MIT License - see the LICENSE file for details.

🗺️ Roadmap

These are the features that are planned for the future. If you have any suggestions, please open an issue.

  • Prerendering endpoints
  • Excluding pages/directories from prerendering with a glob pattern

🙏 Support

If you liked this project, please give it a ⭐️. That's the best way you can support it!