GuavaCZ / filament-knowledge-base

MIT License
144 stars 21 forks source link

[Bug]: Documents in nested folders are not processed #30

Closed damms005 closed 3 months ago

damms005 commented 5 months ago

What happened?

I want markdowns in nested documents to be displayed but when I add them they are not displayed

How to reproduce the bug

Package Version

1.6

PHP Version

8.3

Laravel Version

11.0

Which operating systems does with happen with?

macOS

Notes

No response

lukas-frey commented 5 months ago

Knowledge base currently only allows nesting into 3 levels, due to filament sidebar navigation limitations.

If you want the third level to be displayed (in your case getting-started), you need to:

Your resulting navigation should then look like this:

image
damms005 commented 5 months ago

How do I set the parent in the front-matter? Also, is any of these documented anywhere?

I think there is so much that can be done with the frontmatter but that are largely undocumented, similarly to how I recently learnt about using order in frontmatter

I think a section in the readme/docs deserve to be dedicated to what can be done with frontmatter, and from my explanation above, such section already has at least two sub headings.

lukas-frey commented 5 months ago

How do I set the parent in the front-matter? Also, is any of these documented anywhere?

I think there is so much that can be done with the frontmatter but that are largely undocumented, similarly to how I recently learnt about using order in frontmatter

I think a section in the readme/docs deserve to be dedicated to what can be done with frontmatter, and from my explanation above, such section already has at least two sub headings.

Yeah, as soon as I'll get some time I'll document all missing front matter parameters available.

parent is the property to set the parent.

So in your case, parent: main and in the main.md file you set the title like title: Main for example.

There's a bug that when you don't set the title, it won't use the filename and won't render, otherwise the title property would have been optional.

Will fix it in then next release also.

markwillow commented 3 months ago

@lukas-frey

I tried doing this:

main.md

title: Main

Main Page Content

This is the main page content.

child.md

title: Child Page parent: main

Child Page Content

This is the child page content.

image

markwillow commented 3 months ago

I get it now.

markwillow commented 3 months ago

To clarify the process of creating a parent-child relationship in the left-side navigation panel, please follow these steps:

  1. Create a parent document: Execute the command docs:make test.main.
  2. Update your data: Ensure to set the title, for instance, title: Main.
  3. Create a child document: Execute the command docs:make test.child1.
  4. Update your data: Add a title and specify the parent. For example, parent: Main. Note that this is case-sensitive, so ensure the data matches precisely.
markwillow commented 3 months ago

If you could also implement the third-level relationship, that would be helpful.

lukas-frey commented 3 months ago

Third-level documentation is supported. More is not possible due to filament's limitations.

The first level is a navigation group, second level is a navigation item and third level is a child navigation item within another navigation item. More is not supported by filament currently.