mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
* Allow naive iterables in Taxonomy
Currently, Taxonomy only supports one-level arrays in a Page's Taxonomy, so this works:
```
---yaml
title: XMark Test
taxonomy:
categories: academic
tags: [xmark, link]
author:
- "Ole Vik"
- "Ole Vik"
- "Ole Vik"
---
```
But this does not:
```yaml
---
title: XMark Test
taxonomy:
categories: academic
tags: [xmark, link]
author:
- "Ole Vik"
- "Ole Vik"
- "Ole Vik"
- name: "Ole Vik"
email: "git@olevik.net"
url: "https://olevik.me"
---
```
The change allows another level, to accommodate cases where the Taxonomy contains arrays of strings or hashes. This could potentially be expanded to recursively allow any amount of nesting of Taxonomies.
In both the naive and expanded case, are there implications for finding and filtering by Taxonomies? I've not checked if that recurses through values as I'm not currently at my desktop, but I imagine more changes would be necessary.
* Recursively iterate taxonomy fields
* Accommodate findTaxonomy() by reducing to dot-notation
* Remove superfluous conditional
|
||
|---|---|---|
| .. | ||
| assets | ||
| blueprints | ||
| config | ||
| images/media | ||
| languages | ||
| pages | ||
| src/Grav | ||
| templates | ||
| defines.php | ||
| install.php | ||
| router.php | ||