From 06f6159bb4c26c79eedc5070ffd4a74cf6e528a0 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 4 Feb 2024 13:03:04 +0100 Subject: [PATCH] Merge in front matter data So we can render front matter properties directly in the Blade. (I don't personally see much point in it, but trying it out for now) See note https://github.com/hydephp/develop/pull/1517#issuecomment-1925723795 --- src/BladedownCompiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BladedownCompiler.php b/src/BladedownCompiler.php index 349adf0..909ca37 100644 --- a/src/BladedownCompiler.php +++ b/src/BladedownCompiler.php @@ -15,9 +15,9 @@ public function __construct(BladedownPage $page) public function compile(): string { - return view($this->page->getBladeView(), [ + return view($this->page->getBladeView(), array_merge($this->page->matter->toArray(), [ 'title' => $this->page->title, 'content' => $this->page->markdown->toHtml(static::class), - ])->render(); + ]))->render(); } }