* Added functionality for sorting pages by nested meta values.
* Additional variables removed.
* Added comment to the config template file about the possibility to access nested metadata with a dot as separator for sorting.
* Added entry in the changelog about the possibility to access nested metadata with a dot as separator for sorting.
* Changelog and config template adapted according to the suggestions.
* Added old entry back in the Config template.
This is a workaround for meta pages (i.e. pages starting with a '_'): If a user attempts to request such a page, Pico won't respond with the contents of this meta page, but with a 404 page. This is expected behavior. However, we also have a shortcut in Pico::readPages() attempting to skip reading the contents of the requested page twice. Since we're not serving the contents of the meta page, but of the 404 page, we accidentally overwrite the contents of the meta page by Pico's 404 page. This is unexpected behavior. Even though this commit fixes this particular issue, it doesn't fix its major cause, as the shortcut still exists and can still be triggered by plugin authors by simply overwriting the contents of an existing page. Even though a plugin author might want this to happen, we can't really tell whether it is intended or not. The solution is to remove the shortcut, but we don't want that either, it's a useful performance optimization. The only real solution to this is to switch to page objects, allowing us to handle such situations more verbose. This feature is expected for Pico 4.0. For now we leave this partially fixed...
Fixes#602
As mentioned in https://www.php.net/manual/en/function.basename.php both
basename() and dirname() are locale aware.
An incorrect locale can cause the page tree to behave in strange ways.
For example the structure
/über-uns
|-index.md
|-impressum.md
could lead to the page impressum not being a child of über-uns.
- Add pico-theme.yml with a theme's API version, theme-specific default Twig config, registering theme-specific custom meta headers and defaults for Pico's `theme_config` config
- Add new `onThemeLoading(&$theme)` and `onThemeLoaded($theme, $themeApiVersion, &$themeConfig)` events
- Enable Twig autoescaping by default