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

Option to define groups with front matter #1410

Open
matyalatte opened this issue Jan 4, 2024 · 3 comments
Open

Option to define groups with front matter #1410

matyalatte opened this issue Jan 4, 2024 · 3 comments
Labels
enhancement status: needs discussion Issues that need more discussion before they can be properly triaged.

Comments

@matyalatte
Copy link

matyalatte commented Jan 4, 2024

It would be great if there is an option like is_group to disable href in the main navigation.

---
title: Group1
is_group: true
has_children: true
---

---
layout: default
title: Item1
parent: Group1
---

It can make groups in the same way as parenting. So, It's more intuitive than the collection method.
It can also make child groups in the same way as child pages.

@mattxwang mattxwang added the status: needs discussion Issues that need more discussion before they can be properly triaged. label Jan 8, 2024
@mattxwang
Copy link
Member

Hi @matyalatte, thanks for submitting an issue. To clarify what you're asking for by "disable href", are you asking to add an anchor tag (<a>) for the page but without an href? I'm not sure if this is a great idea - semantically, we shouldn't have anchor tags that don't link to a page. I may be misunderstanding what you're asking for - feel free to follow up!

In addition, would you still render a page for Group1 in your example? If not, this would break quite a bit of the breadcrumb-related functionality (since you would have a page parent without a generated page). If you do want to render a page, then this seems pretty similar to the existing functionality of using parent pages.

@matyalatte
Copy link
Author

Thank you for the reply.

are you asking to add an anchor tag () for the page but without an href?

I mean, to remove the <a> tag to make a shared header like what we can do with the collections.
(nav_disable_link might be a better name than is_group.)

would you still render a page for Group1 in your example?

Yeah, it's a page, to be exact. But it works like a gruop for users.
It would be perfect if it works in exactly the same way as the collenction method, but removing the <a> tags is enough for me.

I prefer consistency than perfectness.
I think front matters should be able to do both of parenting and grouping (or _config.yml should do both of them.)

But it's just a suggestion. I don't mind if you decline it.

@pdmosses
Copy link
Contributor

I think the suggested enhancement would be useful. Similar features were also discussed in #1345 and #1357.

It seems straightforward to implement the omission of the <a> tag from the navigation panel.

It would be perfect if it works in exactly the same way as the collection method

Collections have the following additional features:

  1. They can be non-foldable.
  2. Collection titles are styled differently from page titles.
  3. Any collection can be excluded from search.

Perhaps those features should also be specifiable in the front matter of the proposed grouping pages? Then the current (rather clumsy) way of specifying collections might become completely superfluous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement status: needs discussion Issues that need more discussion before they can be properly triaged.
Projects
None yet
Development

No branches or pull requests

3 participants