docs: use tree shortcode #1067

This commit is contained in:
Sören Weber 2025-03-24 00:53:04 +01:00
parent 6095b777f5
commit 5cc1a55b43
No known key found for this signature in database
GPG Key ID: BEC6D55545451B6D
5 changed files with 100 additions and 97 deletions

View File

@ -11,22 +11,22 @@ 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.
````plaintext
content
├── log
│ ├── first-day
| | |── _index.md
| │ ├── first-sub-page
| | | |── _index.md
| | | |── picture1.png
| | | └── plain.txt
│ ├── second-day
| | |── index.md
| | |── picture1.png
| | └── picture2.png
│ ├── third-day.md
│ └── _index.md
└── _index.md
````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
````
> [!note]

View File

@ -326,19 +326,19 @@ For both sections, the default `shortcuts` Hugo menu should be displayed as if [
Directory structure:
````plaintext
content
├── log
│ ├── first-day.md
│ ├── second-day.md
│ ├── third-day.md
│ └── _index.md
├── ship
│ ├── cargo.md
│ ├── midst.md
│ ├── upper.md
│ └── _index.md
└── _index.md
````tree
- content::folder
- log::folder
- first-day.md::fa-fw fab fa-markdown::secondary
- second-day.md::fa-fw fab fa-markdown::secondary
- third-day.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
- ship::folder
- cargo.md::fa-fw fab fa-markdown::secondary
- midst.md::fa-fw fab fa-markdown::secondary
- upper.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
````
{{% badge style="cyan" icon="gears" title=" " %}}Option{{% /badge %}} {{% badge style="green" icon="fa-fw fab fa-markdown" title=" " %}}Front Matter{{% /badge %}} Using [Hugo's cascade feature](https://gohugo.io/content-management/front-matter/#cascade), we can redefine the menus once in `log/_index.md` and `ship/_index.md` setting `sidebarmenus` so they will be used in all children pages.
@ -371,16 +371,16 @@ You may have the need to add arbitrary links at some point in your menu that sho
Assume the following structure
````plaintext
content
├── log
│ ├── first-day.md
│ ├── second-day.md
│ ├── third-day.md
│ └── _index.md
├── burning-sail-incident.md
├── kraken-incident.md
└── _index.md
````tree
- content::folder
- log::folder
- first-day.md::fa-fw fab fa-markdown::secondary
- second-day.md::fa-fw fab fa-markdown::secondary
- third-day.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
- burning-sail-incident.md::fa-fw fab fa-markdown::secondary
- kraken-incident.md::fa-fw fab fa-markdown::secondary
- _index.md::fa-fw fab fa-markdown::secondary
````
You now want to add a top level menu entry that points to `third-day` as separate `crows-nest-incident`.

View File

@ -64,25 +64,26 @@ Here's how to make your site multilingual using [translations by file name](http
2. Duplicate your content files and add language codes to their file names:
````plaintext
├── content
│ ├── log
│ │ ├── first-day
| | | ├── _index.en.md
| | | └── _index.pir.md
│ │ ├── second-day
| | | ├── index.en.md
| | | └── index.pir.md
│ │ ├── third-day.en.md
│ │ ├── third-day.pir.md
│ │ ├── _index.en.md
│ │ └── _index.pir.md
│ ├── _index.en.md
│ └── _index.pir.md
├── themes
│ └── hugo-theme-relearn
│ └── ...
└── hugo.toml
````tree
- [PROJECT]
- content::folder
- log::folder
- first-day::folder
- _index.en.md::fa-fw fab fa-markdown::secondary
- _index.pir.md::fa-fw fab fa-markdown::secondary
- second-day::folder
- index.en.md::fa-fw fab fa-markdown::secondary
- index.pir.md::fa-fw fab fa-markdown::secondary
- third-day.en.md::fa-fw fab fa-markdown::secondary
- third-day.pir.md::fa-fw fab fa-markdown::secondary
- _index.en.md::fa-fw fab fa-markdown::secondary
- _index.pir.md::fa-fw fab fa-markdown::secondary
- _index.en.md::fa-fw fab fa-markdown::secondary
- _index.pir.md::fa-fw fab fa-markdown::secondary
- themes::folder
- hugo-theme-relearn::folder
- ...::folder
- hugo.toml::file-alt::accent
````
## Translation by Content Directory
@ -113,30 +114,31 @@ The theme also support [translations by content directory](https://gohugo.io/con
2. Duplicate your content files into separate directories named by their language code:
````plaintext
├── content
│ ├── en
| │ ├── log
| │ │ ├── first-day
| | | | └── _index.md
| │ │ ├── second-day
| | | | └── index.md
| │ │ ├── third-day.md
| │ │ └── _index.md
| │ └── _index.md
│ ├── pir
| │ ├── log
| │ │ ├── first-day
| | | | └── _index.md
| │ │ ├── second-day
| | | | └── index.md
| │ │ ├── third-day.md
| │ │ └── _index.md
| │ └── _index.md
| ├── themes
| │ └── hugo-theme-relearn
| │ └── ...
| └── hugo.toml
````tree
- [PROJECT]
- content::folder
- en::folder
- log::folder
- first-day::folder
- _index.md::fa-fw fab fa-markdown::secondary
- second-day::folder
- index.md::fa-fw fab fa-markdown::secondary
- 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
- pir::folder
- log::folder
- first-day::folder
- _index.md::fa-fw fab fa-markdown::secondary
- second-day::folder
- index.md::fa-fw fab fa-markdown::secondary
- 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
- themes::folder
- hugo-theme-relearn::folder
- ...::folder
- hugo.toml::file-alt::accent
````

View File

@ -7,20 +7,21 @@ weight = 1
If you've followed the [Getting Started](introduction/quickstart) guide, your directory layout will look similar to this:
````plaintext
├── content
│ ├── log
│ │ ├── first-day
| | | └── _index.md
│ │ ├── second-day
| | | └── index.md
│ │ ├── third-day.md
│ │ └── _index.md
│ └── _index.md
├── themes
│ └── hugo-theme-relearn
│ └── ...
└── hugo.toml
````tree
- [PROJECT]
- content::folder
- log::folder
- first-day::folder
- _index.md::fa-fw fab fa-markdown::secondary
- second-day::folder
- index.md::fa-fw fab fa-markdown::secondary
- 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
- themes::folder
- hugo-theme-relearn::folder
- ...::folder
- hugo.toml::file-alt::accent
````
Hugo uses a [union file system](https://gohugo.io/getting-started/directory-structure/#union-file-system), which lets you combine multiple directories.

View File

@ -1 +1 @@
7.5.0+985af47e3ffb717360ce812c6f96780afc9a5ad4
7.5.0+6095b777f5fc176bb5ba11614d09e746d1479442