tree: make more robust, change separator

This commit is contained in:
Sören Weber 2025-03-24 15:04:52 +01:00
parent c062fd1ed2
commit c5d591c514
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
9 changed files with 191 additions and 179 deletions
docs/content/authoring

View file

@ -442,37 +442,37 @@ Markdown will automatically number each of your items consecutively. This means,
{{% badge color="#7dc903" icon="fa-fw fas fa-puzzle-piece" %}}Relearn{{% /badge %}} You can add lists as a tree with configurable icons and colors.
Text can be followed by optional double colons (`::`) to define the icon and another optional double colons to define the icon's color.
The name can be followed by an optional pipe (`|`) to define an icon and further optional pipe to define the icon's color.
More details can be found in the [`tree` shortcode docs](shortcodes/tree).
````md
```tree
- home::folder
- .config::folder
- My Documents::folder::gold
- home | folder
- .config | folder
- My Documents | folder | gold
- index.html
- resume.odt::file-word::#df6f40
- Images::folder
- resume.odt | file-word | #df6f40
- Images | folder
- pic1.jpg
- pic2.jpg::file-image::secondary
- Code::folder
- home.php::fa-fw fab fa-php::#888cc4
- pic2.jpg | file-image | secondary
- Code | folder
- home.php | fa-fw fab fa-php | #888cc4
```
````
{{% notice style="code" icon="eye" title="Result" %}}
```tree
- home::folder
- .config::folder
- My Documents::folder::gold
- home | folder
- .config | folder
- My Documents | folder | gold
- index.html
- resume.odt::file-word::#df6f40
- Images::folder
- resume.odt | file-word | #df6f40
- Images | folder
- pic1.jpg
- pic2.jpg::file-image::secondary
- Code::folder
- home.php::fa-fw fab fa-php::#888cc4
- pic2.jpg | file-image | secondary
- Code | folder
- home.php | fa-fw fab fa-php | #888cc4
```
{{% /notice %}}

View file

@ -12,21 +12,21 @@ The theme generates the navigation menu out of the given directory structure.
Organize your site like [any other Hugo project](https://gohugo.io/content/structure/). Typically, you will have a _content_ directory with all your pages.
````tree
- content::folder
- log::folder
- first-day::folder
- _index.md::fa-fw fab fa-markdown::secondary
- first-sub-page::folder
- _index.md::fa-fw fab fa-markdown::secondary
- picture1.png::file-alt::accent
- plain.txt::file-alt::accent
- second-day::folder
- index.md::fa-fw fab fa-markdown::secondary
- picture1.png::file-alt::accent
- picture2.png::file-alt::accent
- third-day.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
- content | folder
- log | folder
- first-day | folder
- _index.md | fa-fw fab fa-markdown | secondary
- first-sub-page | folder
- _index.md | fa-fw fab fa-markdown | secondary
- picture1.png | file-alt | accent
- plain.txt | file-alt | accent
- second-day | folder
- index.md | fa-fw fab fa-markdown | secondary
- picture1.png | file-alt | accent
- picture2.png | file-alt | accent
- third-day.md | fa-fw fab fa-markdown | secondary
- _index.md | fa-fw fab fa-markdown | secondary
- _index.md | fa-fw fab fa-markdown | secondary
````
> [!note]