I have a site using the hugo-coder theme, which has a layouts/posts folder that specifies that anything in the "posts" folder will have a blog post format.
I would like to have two different blogs in two different subdirectories, using the same layout. Is there a way to tell Hugo that the content/blog1 directory should use the same settings and layout as the content/posts directory without copying themes/hugo-coder/layouts/posts into layouts/blog1? Ideally I would avoid using symlinks, because, while convenient, I've had a decent amount of software throw weird errors when I use symlinks, so I avoid them when it's possible.
You can set thelayoutortypefield topostsin the frontmatter of your_index.mdfile incontent/blog1.See this docs page for more info.
Edit: Alternatively, you could create an archetype for
blog1that automatically sets the value topostsin the frontmatter of individual posts in that section, assuming you're usinghugo new blog1/postname.mdto create posts for that section.Double edit: The first suggestion didn't work. You could also create subsections within
content/posts/blog1and set the permalinks of posts in that subsection to use the last section only. That should remove the need to explicitly set the type in post frontmatter every time because each post would already have a type of posts.In
config.toml: