Make use of Native YAML parser if available (big speed boost!!)

This commit is contained in:
Andy Miller
2015-10-15 17:40:16 -06:00
parent d4c4f8593e
commit 2b8adfee05
2 changed files with 5 additions and 0 deletions

View File

@@ -22,6 +22,9 @@ trait CompiledFile
*/
public function content($var = null)
{
// Set some options
$this->settings(['native' => true, 'compat' => true]);
// If nothing has been loaded, attempt to get pre-compiled version of the file first.
if ($var === null && $this->raw === null && $this->content === null) {
$key = md5($this->filename);

View File

@@ -259,6 +259,8 @@ class Page
if (!$this->header) {
$file = $this->file();
if ($file) {
// Set some options
$file->settings(['native' => true, 'compat' => true]);
try {
$this->raw_content = $file->markdown();
$this->frontmatter = $file->frontmatter();