Closed yukixctuki closed 1 year ago
Hi there.
Glad you like the tool, I really like your netlify theme and am looking forward to you submitting it to the main branch of NotionNext.
Obviously, your main problem is in this code.
<form
name="contact"
method="POST"
data-netlify="true"
className="space-y-4"
action="/"
>
method="POST" , action="/"
It means that requesting your "/" page with a POST request, (which is the home page https://exmuslims.in), but the home page is apparently only supported to be accessed with GET, so it returns a 405 error.
What is the HTTP request method, this link gives an explanation:
You can refer to the steps in this link and try to create a page for receiving user submissions, but it's somewhat difficult
https://newdevzone.com/posts/how-to-handle-a-post-request-in-nextjs
Thank you for your kind words <3
As per Netlify's documentation on forms the for doesn't require action
attribute and after reading a little it seemed like a really dumb mistake from my part.
I have used Netlify forms in Gatsby & Nextjs static site before and it worked out of the box.
I've removed the action
attribute and tested but it this time it says Bad request, missing form
I'll see if can make use of the links you provided.
Many thanks!
About submitting the theme 😅 I'll definitely clean up the code and try to make a PR. I know I should be respecting the license and I am keen about releasing the source code, I just have to clean up a little :)
I created a new
themes/hexo/LayoutContact
page on which I am trying to use Netlify forms, I've followed Netlify's documentation for forms but I am not able to send(submit the form), it throws405 | Method not allowed
error. I am not sure how to proceed with this. I am a beginner and would appreciate your help.The
/pages/contact.js
looks like:The
/themes/hexo/LayoutContact.js
looks like:相应配置
https://exmuslims.in
截图
环境
Thanks for making this amazing generator.