Add missing registred meta headers

Use the `Formatted Date` meta header to explicitly set a page's formatted date (i.e. `$meta['date_formatted']`), and `Time` to set `$meta['time']`. Use the `Hidden` meta header to manually hide a page (the page is still accessible, but won't show up in the pages list). Note the difference between `$pageData['hidden']` and `$pageData['meta']['hidden']`.
This commit is contained in:
Daniel Rudolf 2018-07-29 12:51:28 +02:00
parent a7df4c2115
commit c7d4d25ab3
No known key found for this signature in database
GPG key ID: A061F02CD8DE4538

View file

@ -1278,8 +1278,11 @@ class Pico
'Description' => 'description', 'Description' => 'description',
'Author' => 'author', 'Author' => 'author',
'Date' => 'date', 'Date' => 'date',
'Formatted Date' => 'date_formatted',
'Time' => 'time',
'Robots' => 'robots', 'Robots' => 'robots',
'Template' => 'template' 'Template' => 'template',
'Hidden' => 'hidden'
); );
$this->triggerEvent('onMetaHeaders', array(&$this->metaHeaders)); $this->triggerEvent('onMetaHeaders', array(&$this->metaHeaders));
@ -1374,7 +1377,6 @@ class Pico
} else { } else {
// guarantee array key existance // guarantee array key existance
$meta = array_fill_keys($headers, ''); $meta = array_fill_keys($headers, '');
$meta['time'] = $meta['date_formatted'] = '';
} }
return $meta; return $meta;
@ -1609,7 +1611,7 @@ class Pico
'time' => &$meta['time'], 'time' => &$meta['time'],
'date' => &$meta['date'], 'date' => &$meta['date'],
'date_formatted' => &$meta['date_formatted'], 'date_formatted' => &$meta['date_formatted'],
'hidden' => (bool) preg_match('/(?:^|\/)_/', $id), 'hidden' => (preg_match('/(?:^|\/)_/', $id) || $meta['hidden']),
'raw_content' => &$rawContent, 'raw_content' => &$rawContent,
'meta' => &$meta 'meta' => &$meta
); );