refactored to make more reliable

This commit is contained in:
Andy Miller
2014-09-20 15:33:41 -06:00
parent 103369cc64
commit a39656d536

View File

@@ -144,7 +144,19 @@ class Page
public function frontmatter($var = null) {
if ($var) {
$this->frontmatter = $var;
$this->frontmatter = (string) $var;
// Update also file object.
$file = $this->file();
if ($file) {
$file->frontmatter((string) $var);
}
// Force content re-processing.
$this->id(time().md5($this->filePath()));
}
if (!$this->frontmatter) {
$this->header();
}
return $this->frontmatter;
}