I have a component, image.svelte
which renders an SVG file. On one route, say /image
, I want a page that includes that component rendered within an HTML document. But if you go to /image.svg
, I want just the SVG document by itself and I want the page to be served with Content-Type: image/svg+xml
.
I started by making creating a file like src/routes/image[ext]/+page.svelte
, but there doesn't seem to be a way to break out of src/app.html
.
Next I tried making two files, src/routes/image/+page.svelte
and src/routes/image.svg/+server.js
, but it doesn't seem to be possible to render components directly from a server-side script in SvelteKit.
So I'm at a loss and haven't find what I'm looking for in the docs.