How to add an extra standalone page on single page hugo-icon theme?


I am new to hugo and have created a small site using the hugo-icon theme.

Hugo-icon is a single page theme with a contact form. This form is supposed to send entered data to a form mail service that will then send a mail to the website owner with the message from the user. This is all fine and well. However, the form mail service should be able to send the user back to one of two URLs:
1: If submission was a success: A “thank-you” page that tells the user thank you for your interest

or 2: If the submission failed for some reason: An “error” page that tells the user that submission failed for whatever reason.

Problem is that I cannot seem to figure out how to add these two extra pages: “thank-you” and “error”.

I have tried making a new in content using the command: “hugo new”. This does create a new file in content and I have put in some content in there. However, this page is not shown on the site. If I go to /thank-you, I get a 404.

So I guess I am missing some kind of mapping of this URL to the actual content page. How to do this?

I have tried to also create a “thank-you.html” under layouts, but that does not seem to help.
I have read all what I can find about themes and customizing themes on gohugo docs.

I hope you can help.


You simply assign a type = "page" in the front matter of and then you move and rename the thank-you.html template under /layouts/page/single.html

See the Hugo docs for more on Content Type.

Thanks! That works.

By placing the template there it works, but if I try to style the pages using the single template like the main one I can’t get the static assets.
The browser is looking for /thank-you/js/…

How can I do to load the same assets of original theme?

I placed the page/single.html inside the “layouts” dir of the theme

What are you using as the url of the js file? You should use absURL or relURL so that it links to the correct place.

Yours seems to be a completely different issue than the one discussed in this thread.

Please start a new thread, and provide an example site repo that demonstrates your problem. It’s difficult to debug/help with your issue without that.