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

Customise breadcrumbs link for hierarchical categories #326

Open
GitMew opened this issue Aug 6, 2023 · 0 comments
Open

Customise breadcrumbs link for hierarchical categories #326

GitMew opened this issue Aug 6, 2023 · 0 comments

Comments

@GitMew
Copy link

GitMew commented Aug 6, 2023

I have a post stored at posts/example/nested/deeper/_posts/2023-08-06-deepest-post-ever.md (note that I have an explicit top-level folder called posts) whose heading appears as follows:

image

Example is linked in the path below the title because it is in my _featured_categories folder. The link points to /categories/example because my config currently contains the excerpt

collections:
  featured_categories:
    permalink:         /categories/:name/
    output:            true

In contrast, every part in the breadcrumbs above the title (which I want to keep) have a link. For the category Example, the link points to /posts/example. For the category Deeper, it is /posts/example/nested/deeper.


Now, given this setup, I have several issues that need resolving:

  1. The breadcrumbs above and below the title should obviously link to the same page. In the above, either the top breadcrumb should link to /categories/example or the bottom should link to /posts/example. I don't see why these shouldn't be the same. At the very least, there should be a way to turn off link anchors in the breadcrumbs (rather than removing them altogether) so that they are just static text.
  2. Hierarchy of categories should be supported by preventing aliasing. Due to the config above, if I have /posts/example/nested and /posts/test/nested, these should not both have /categories/nested as their path, since this is the behaviour of a tag (flat) rather than a category (hierarchical). The permalink template's :name seems to only take the leaf name in the hierarchy (example) rather than the path name (posts/example), and hence causes aliasing.

Ideally, the links for the respective path parts above and below the title are identical and a subpath of /categories. In the above example, there would be 4 unique links in total: /categories/posts, /categories/posts/example, /categories/posts/example/nested and /categories/posts/example/nested/deeper.

Clearly, Hydejack attempts to support hierarchical categories, since the breadcrumbs are formatted as a /-separated string. The hierarchy should hence also be configurable.

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

1 participant