Type something to search...

Blog

How to build API endpoints in Astro?

How to build API endpoints in Astro?

To build an API endpoint in Astro, create a .js or .ts file in src/pages/ and export a function named after an HTTP method, such as GET or

Dive Deeper
How to add user authentication to an Astro site?

How to add user authentication to an Astro site?

To add user authentication to an Astro site, install an adapter so pages can run on demand, choose an auth library such as Better Auth or a h

Dive Deeper
How to add pagination to an Astro blog?

How to add pagination to an Astro blog?

To add pagination to an Astro blog, create a dynamic page such as src/pages/blog/[...page].astro, load and sort your posts inside `getStaticPaths()

Dive Deeper
How to cache on-demand rendered pages in Astro?

How to cache on-demand rendered pages in Astro?

To cache on-demand rendered pages in Astro, configure a cache provider with the top-level cache option in astro.config.mjs, then tell Astro w

Dive Deeper
How to style child components with class:list in Astro?

How to style child components with class:list in Astro?

To style a child component with class:list in Astro, make the child accept a class prop, combine it with its own classes using `class:list={["a

Dive Deeper
What do client:load, client:idle, and client:visible mean in Astro?

What do client:load, client:idle, and client:visible mean in Astro?

In Astro, client:load, client:idle and client:visible are client directives that decide when a UI framework component's JavaScript is d

Dive Deeper