Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help me to Implement search option, tags and category page #40

Closed
rokib-rajon opened this issue Jul 20, 2021 · 3 comments
Closed

Help me to Implement search option, tags and category page #40

rokib-rajon opened this issue Jul 20, 2021 · 3 comments

Comments

@rokib-rajon
Copy link

I have tried several methods found on the internet to implement a search option and add a page for tags and categories, but nothing works with this theme. As a non programmer, its hard for me to do this. Can you give me a good documentation which will work with this amazing theme?

Thanks in advance !

@juhair-cupcake
Copy link
Contributor

For tags and category try Taxonomies from hugo docs.

@rokib-rajon
Copy link
Author

@Error6251 Tried the methods you mentioned, but no results. After few hours of trying I found a way to do it. Copied the code from the layout of blog list page, I pasted it on default list page. Then I change the range from {{ range .Paginator.Pages }} to {{ range $index, $page := .Paginator.Pages }}. It solved the problem partially. It can not render page to show all taxonomies at once like /category or /tags, but able to render page for single taxonomy like /category/lorem or /tags/lorem. How can I solve this issue ?

@juhair-cupcake
Copy link
Contributor

juhair-cupcake commented Jul 26, 2021

From the Doc. You need to declare taxonomies on your config.toml file Read here.
[taxonomies]
tag = "tags"

On your content's markdown file add "tags"
tags: "news"

Then, You need to create a folder named "tags" on your "layout" folder and create a taxonomy.html file on that folder.
layouts/tags/taxonomy.html

For more info.

For Example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants