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

Taxonomy links for categories and tags are not generating properly under posts #47

Closed
mattmc3 opened this issue Jul 11, 2024 · 2 comments

Comments

@mattmc3
Copy link
Contributor

mattmc3 commented Jul 11, 2024

Under posts where the categories and tags are rendered as links, the links result in a 404. The right sidebar links work however. For example, if there were a category named Tutorial, the post link is be incorrect: http://mattmc3.github.io/categories/page/categories/tutorial/, while the sidebar link is correct: http://mattmc3.github.io/categories/tutorial/.

Screenshot 2024-07-11 at 10 39 19 AM

I was able to fix this by adding a layouts/partials/block/taxonomies.html file and changing the link generation snippet to the following:

<a href="{{ (urlize (printf "/categories/%s" .LinkTitle )) | relLangURL }}/"
   class="text-sm mr-2 px-2 py-1 rounded border border-emerald-800 bg-emerald-800 text-slate-50">
   {{ .LinkTitle }}
</a>

I'm not sure if there's something I'm missing from the instructions that I should have put in my hugo.toml file, but here's my site where I had to apply the fix: https://github.com/mattmc3/mattmc3.github.io

I'm relatively new to Hugo, so let me know if there's a better way, or if this is a bug you aren't seeing yourself.

Thanks for the cool theme!

@Saggiehaim
Copy link

I just posted a question about it. I applied this fix on my site and its working.
Thank you!

@tomowang
Copy link
Owner

Thanks for the reporting. It seems related to the fix of #45, which add the title for taxonimies. I'll take a look.

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

3 participants