-
-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New hook onRenderContent()
: generate non-HTML files with arbitrary content
#1525
Comments
So far the recommendation for these two use cases are to use a post-build script (without using Vite). I agree that being able to use Vite for transpiling the post-build script would be nice. In the meantime, can you fallback to use other utilities such as Why not adding a new CLI command Or maybe a new Vike hook Spontaneously I like Also, what do other frameworks do to support these two use cases? Can someone dig into that? |
lume allows generating arbitrary file content. lume has a sitemap plugin. To set the page URL in lume, you simply do export const url = "/feed.json"; or
Eleventy allows generating arbitrary content too. It has a RSS plugin which only provides data and needs the user to provide a template for it. You can use the RSS plugin to generate a site map with the correct template. |
Or how about using Filesytem Routing as usual?
You shouldn't do that in dev, see https://vike.dev/markdown#metadata. Upon pre-rendering you can already access that, although it's currently hidden behind an internal API: It makes sense that SSGs like Lume and Eleventy supports that use case. I was more wondering about SSR frameworks such as Next.js or Nuxt. |
How do I generate Also, I can't name a folder
In those frameworks, the Atom feed is usually an API route, and vike made the decision to not support API routes (I read that in the docs). |
Vike wouldn't create an
You could use a Route String.
You can use an Express.js/Fastify/Hono/... route instead. Note that we're currently working on #562. I stand to be corrected, but I believe that once |
I need a static page!
A route string of In #562, you linked to vite-node. I'll try writing a script with that. Thanks for the idea! |
@iacore It will create a file, it just won't be a |
onRenderContent()
: generate non-HTML files with arbitrary content
Since there is a workaround and there are only two use cases for it, I'm labeling this as That said, the priority can be increased by:
|
The I haven't tried |
Apologies I meant
It isn't. I think it's fine for now as there are currently a lot of higher priorities regarding the docs. |
I assume you meant
as of vike 0.4.165, it generates
|
Interesting approach by SvelteKit: https://kit.svelte.dev/docs/seo#manual-setup-sitemaps |
Description
I hope vike can generate files that is not HTML and without injected tags.
The requirements are
import.meta.glob
)Related: #1522 #1524
Use Cases
The text was updated successfully, but these errors were encountered: