A way to create "traditional" cagegories, tags for blog posts

Hello, I have just started looking into taxonomies, but the goal I have is to replicate a simple category, tag on a blog site. There are two things I would like to achieve:

  1. Disable the taxonomy pages, e.g. $TAXONOMY_NAME/list.html
  2. Embed categories and or tags in the blog post template - for example as a top banner, or side panel etc.

I haven’t yet discovered anything in the documentation that might let me do the above. Is there some information on this, or should I instead look at the Zola source directly?

  1. I don’t know a mechanism to disable list of taxonomy inside Zola, but you can add redirect with 301 or 302 on your webserver

{% if page.taxonomies.tags %}
<ul>
        {% for tag in page.taxonomies.tags %}
        <li><a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}" itemprop="url">#{{ tag }}</a></li>{% if page.taxonomies.tags | length > 1 %}{% if loop.index != page.taxonomies.tags | length %},{% endif %}
        {% endif %}
        {% endfor %}
<ul>
        {% endif %}

Thank you. I see how that works, I think, I will experiment with it further. Perhaps what I was asking for didn’t make complete sense. (point #1)

About point 1, it depends of where your website will be hosted. if you control your nginx\apache\thenewonemodernwebserver settings - you could easily handle redirect from http://company.com/tags to where you want.

Hey @Murk !

When I was messing around trying to put categories/tags in my own blog post template, I found the DeepThought theme VERY helpful, as they have a github and a live site that are basically in sync. So I could click around on the site (e.g. tags shown at top of post here) and then find the code/markdown/template/macro that corresponded to it (for the previous example, here, here, and here are relevant).

I suspect this learning approach would work with other themes too, but I haven’t personally tried it.

Good luck, have fun!

-Z

Thank you Zeph. I will take a look at that one. I think I will be able to achieve what I was after.

I personally go a little step further. All the sites i maintain with my homegrown theme display in the footer a link to the actual page source. Examples:

Thanks for reminding me, i had forgotten to add info about it in the theme README. The theme is not ready yet to be published, but i’m interested to have feedback about it or the README if you find time to contribute criticism :wink:

@southerntofu That is very snazzy, thanks for the links! I don’t have a ton of time to look at things in detail at the moment, but I may nab your “link to code in footer” idea in the future.

Oh please do! It’s not “my” idea to begin with. I don’t remember where i got it from, but i saw people doing that with a static site (while i thought only wikis did that), which made me think i should do it myself, and also made me question the whole website/wiki dichotomy (they’re not that different and given proper tooling a static site can be a very good wiki).