I have an issue with the way hugo is currently creating files in public directory
Issue : Following directories are generated {They both are identical files}
public/posts/page/1/index.html
public/page/1/index.html
Is there any way to tell hugo to stop rendering files into posts directory but continue to generate them under public. Also can the solution be implemented vice-versa?
Folder structure of content directory :
content/posts/post1
content/posts/post2
No. On a personal site I actually just delete the posts directory via rm -rf posts. The issue is, that you might have somewhere in your layouts or content files a reference to the posts directory. Delete it manually and test your site if any links stop working. Your specific case is that your startpage is not a dedicated page, but the “posts” lists itself. which is a double, yeah… maybe a canonical meta link will soothe your issues.
Regarding the vice-versa - that depends on the structure of your content directory. It might be possible to add a _index.md directly in your content directory and forward calls to / to /posts/ instead. But that might break your whole site depending on your content structure. Versa-vise seems the better solution.
Thanks!! @davidsneighbour I think 2nd option might work. I will use root index file to just render only a handful of posts and include a button that redirects to /posts for paginated pages. Appreciate the quick response
Have a great day!!