Skip to content

Present only Categories on Sidebar #49

Answered by tomowang
Saggiehaim asked this question in Q&A
Discussion options

You must be logged in to vote

I use range loop for rendering this part in sidebar. You can check the code in
https://github.com/tomowang/hugo-theme-tailwind/blob/main/layouts/partials/sidebar.html#L14-L19

If you want keep only Categories, you can remove the range loop and render the block/sidebar_section.html directly. Sample code:

{{ partial "block/sidebar_section.html" (dict "Context" site.Taxonomies.categories "Taxonomy" "categories" "Limit" 10) }}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Saggiehaim
Comment options

Answer selected by Saggiehaim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants