Skip to content
Discussion options

You must be logged in to vote

SvelteKit only has two types of route, pages which are defined by .svelte files, and endpoints which are defined by either .js or .ts files, see https://kit.svelte.dev/docs/routing. For static files that are served as-is, you're looking for the kit.files.assets option, which defaults to static directory, see https://kit.svelte.dev/docs/configuration#files and the demo app example.

To answer your question, there are 2 ways to go about this. If you're looking to generate the images in relation to your path, then you'll need to create an endpoint file that has the image extension as the suffix and returns the image blob as the body, ex. -> <app>/src/routes/blog/[slug]/an-image.jpg.ts.

The ot…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@rsolvang
Comment options

@wrex
Comment options

@kaiwen-wang
Comment options

Comment options

You must be logged in to vote
2 replies
@rsolvang
Comment options

@nosovk
Comment options

Answer selected by rsolvang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants