How to serve Primo pages from SvelteKit

You can use the serverside load hook to intercept requests based on a blocklist or allowlist and fetch/return a static Primo page from the site’s repository instead.

This is useful when you have some content pages in your SvelteKit app that you want to have easily by yourself and other content editors, or when you have a full Primo site that you want to wrap in a SvelteKit application.

Example

Here’s a repo that demonstrates how to load Primo pages from a SvelteKit codebase.