hugo-coder icon indicating copy to clipboard operation
hugo-coder copied to clipboard

How to automatically map the posts to category and display on home page

Open tcprks opened this issue 3 years ago • 4 comments

I am using hugo coder theme. is it possible to create a new page something like categories instead of project where it will show the post under BLOG based on the category of the posts. something like attached picture. I have created a category page by editing the config file by renaming the Projects( which was default in coder theme). It just displays the categories. How to display the posts as well. cat cat1 My page which shows only categories, No posts displayed noposts

tcprks avatar Feb 16 '22 06:02 tcprks

It is possible to do that, but you will need to override or create some template files. Try creating a new taxonomy template for projects. Probably you will need to use the partial list template too.

luizdepra avatar Feb 16 '22 13:02 luizdepra

where should i create this new taxonomy template. which folder i should upload. Should i overwrite any existing file. I believe we have taxonomy details only in config file

tcprks avatar Feb 16 '22 14:02 tcprks

You should but the new taxonomy template in the same path as the other, in layout/partial/taxonomy. You don't need to change this theme files directly, but you could if you want to do it. If you create the same directory structure in your site project, Hugo will know that you are adding new templates or overriding existing ones.

luizdepra avatar Feb 20 '22 16:02 luizdepra

Would be extremely grateful if someone figure this out and is willing to share it ♥️

erickhun avatar Mar 11 '22 06:03 erickhun