#ssg

1 messages · Page 1 of 1 (latest)

violet jacinthBOT
#

Hi @robust prairie. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

In Astro, you can configure a particular page to be server-side rendered by using the output: 'server' or output: 'hybrid' modes in your Astro configuration.

For instance, to configure a highly dynamic app where every page is rendered on demand by default, you can add output: 'server' to your Astro config:

// astro.config.mjs
import { defineConfig } from 'astro/config';
import node from "@astrojs/node";

export default defineConfig({ 
  output: 'server', 
  adapter: node({ mode: "standalone" })
});

However, if you want to override the default on-demand rendering of server mode on a specific page or route, you can do so by exporting const prerender = true in that page:

// src/pages/my-static-page.astro
---
export const prerender = true;
// ...
---
<html> <!-- Static, pre-rendered page here... --></html>

This will make the specific page statically pre-rendered, overriding the default server-side rendering.

For more information, you can refer to the Astro documentation on server-side rendering (https://docs.astro.build/en/guides/server-side-rendering#configure-server-or-hybrid).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: