-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat: Add sitemap plugin #217
Conversation
Hi @kbkn3 Thank you for the awesome PR! I've tried it with The build command is the following: vite build --mode client && vite build Can you take a look? And if you can, please describe this feature in After that, I'll review the details. |
Hi @yusukebe, Thank you for reviewing my PR. I had never run the I've also added the README as requested. Please take a look when you have a chance! English isn't my first language, so please let me know if anything is unclear. |
05cde39
to
32c9632
Compare
The commit adds the sitemap plugin and updates the `vite.config.ts` file to include the necessary configuration for generating a sitemap. It also mentions the usage of the `honox` plugin and the `pages` plugin for Cloudflare Pages deployment.
Thank you for handling them. There is a big problem with this plugin. If it has the following route on import { Hono } from 'hono'
const app = new Hono()
app.get('/me', (c) => {
return c.render(<h1>About me!</h1>)
})
export default app We have to consider this patter. The |
I had forgotten that notation existed... It seems that I will try to implement a node-based replacement for the file-based routing of I get the following error when using
|
I will wrap the following to create a function that summarizes the process
import { Hono } from 'hono'
import { inspectRoutes } from 'hono/dev'
import app from '../server'
const route = new Hono()
route.get('/', c => {
const routes = inspectRoutes(app)
console.log(routes)
return c.body(
`<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
</urlset>`,
200,
{
'Content-Type': 'application/xml',
},
)
})
export default route |
Hi @kbkn3 I think we can make a hook of the SSG Helper for creating Sitemap. I'm not sure it's correct but it may be made as And we have @hono/vite-ssg. This plugin can support We have to consider the API design, but we may make the feature for Sitemap with them. |
And, if we follow the method, the hook for creating a Sitemap is not only for HonoX. It can be used in the apps using SSG Helper. |
@yusukebe I came up with a way to output the sitemap as a normal route, so I implemented it as a function and pushed it. However, it seems smarter to implement it as a hono function using @hono/vite-ssg. |
7116e95
to
c86686a
Compare
Okay! Thank you very much! |
Close #216