Add hide_list metadata option to directories
Add support for hide_list metadata option that allows directories to be displayed as pages instead of lists when they contain subfolders
This commit is contained in:
parent
a205f2cbd7
commit
441c8bca68
2 changed files with 23 additions and 0 deletions
|
|
@ -64,6 +64,14 @@ switch ($parsedPath['type']) {
|
||||||
// Load metadata for this directory
|
// Load metadata for this directory
|
||||||
$metadata = loadMetadata($dir);
|
$metadata = loadMetadata($dir);
|
||||||
|
|
||||||
|
// Check if hide_list is enabled - if so, treat as page
|
||||||
|
if (isset($metadata['hide_list']) && $metadata['hide_list']) {
|
||||||
|
if (!empty($contentFiles)) {
|
||||||
|
renderMultipleFiles($ctx, $contentFiles, $dir);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Select list template based on metadata page_template
|
// Select list template based on metadata page_template
|
||||||
$listTemplate = $ctx->templates->list;
|
$listTemplate = $ctx->templates->list;
|
||||||
if (isset($metadata['page_template']) && !empty($metadata['page_template'])) {
|
if (isset($metadata['page_template']) && !empty($metadata['page_template'])) {
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,20 @@ The actual folder is `about/`, but URLs become:
|
||||||
- `/no/om-oss/` (Norwegian)
|
- `/no/om-oss/` (Norwegian)
|
||||||
- `/fr/a-propos/` (French)
|
- `/fr/a-propos/` (French)
|
||||||
|
|
||||||
|
### hide_list
|
||||||
|
|
||||||
|
**Type**: Boolean
|
||||||
|
**Used in**: Directories with subdirectories
|
||||||
|
**Purpose**: Hide list of subfolders and show only page content
|
||||||
|
|
||||||
|
```ini
|
||||||
|
hide_list = true
|
||||||
|
```
|
||||||
|
|
||||||
|
When enabled, directories with subfolders display as regular pages instead of showing a list view. Useful when you need subfolders for organization but want to present a single page to visitors.
|
||||||
|
|
||||||
|
Accepted values: `true`, `false`, `1`, `0`, `yes`, `no`, `on`, `off`
|
||||||
|
|
||||||
### redirect
|
### redirect
|
||||||
|
|
||||||
**Type**: URL string
|
**Type**: URL string
|
||||||
|
|
@ -186,6 +200,7 @@ last_updated = "2025-11-02"
|
||||||
; Display options
|
; Display options
|
||||||
hide_date = true
|
hide_date = true
|
||||||
hide_author = false
|
hide_author = false
|
||||||
|
hide_list = true
|
||||||
show_toc = true
|
show_toc = true
|
||||||
|
|
||||||
; External references
|
; External references
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue