Skip to content

Add a "richer" taxonomy configuration #5520

Open
@bep

Description

@bep

See #5513 -- I will fix that issue so it works as described there, but looking at that issue I realize that many taxonomy related workarounds (and also limitations on what we can do) is rooted in the litle bit to limited configuration options.

In the above issue, @randallmlough was creative and created a taxonomy configuration like the one below:

[taxonomies]
"news-tag" = "news/tags"
"news-category" = "news/categories"

I have made the above a little simpler to wrap my head around it.

The term in the source code used about a taxonomy configuration definition is that the key (news-tag is the singular form and the value is plural. The plural is what you define in front matter and that is used to construct the taxonomy URLs (e.g. news/categories/index.html).

The above works nicely, but you get a tight coupling between content and taxonomy URLs and possibly miss out on other features that is now hard to implement.

I suggest that we as an alternative to the string plural allows a more "complex object":

[taxonomies]
[taxonomies.news-categories]
path = "news/categories"
title = "This is the news"
weight = 30

The above is quickly jotted down, but the thought is that it is the name that defines the front matter key (note that this will default to path which is the same as plural in the "old" way).

This would also make the content less coupled to the URL config:

+++
title = "foo"
news-tags = ["a", "b", "c"]
+++

Content.

/cc @regisphilibert @kaushalmodi @digitalcraftsman @onedrawingperday and gang

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions