I need some help.
I created a theme and everything is working good with the index page.
Now i want to create posts.
So I tried to create a new post called “bonjour” with the command
hugo new post/bonjour
When I’m checking on localhost how its look, look at the result
2 questions :
1. Why the code is not interpreted?
2. How can I create a special layout for posts?
I guess that Hugo doesn’t know how to interpret the file’s content. Depending on the file extension, which is missing in this case, Hugo will use different parsers for your content.
You can create a special layouts by adding a folder called
post to the
layouts directory. Now you can add templates like
single.html that are just used for this type.
Try renaming content/post/bonjour to content/post/bonjour.md and running hugo again. That
.md extension is important and isn’t supplied by the “new” command.