From 20eb10e3104722c0376ce3cc2e95c86048a7ad48 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 26 Nov 2023 20:33:00 +0100 Subject: [PATCH] Render custom footer text when not boolean Fixes https://github.com/hydephp/develop/issues/1474 --- .../components/docs/sidebar-footer-text.blade.php | 6 +++++- packages/framework/tests/Feature/SidebarViewTest.php | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/framework/resources/views/components/docs/sidebar-footer-text.blade.php b/packages/framework/resources/views/components/docs/sidebar-footer-text.blade.php index 4bafb848d1d..6b49ca39bb1 100644 --- a/packages/framework/resources/views/components/docs/sidebar-footer-text.blade.php +++ b/packages/framework/resources/views/components/docs/sidebar-footer-text.blade.php @@ -1,3 +1,7 @@

- Back to home page + @if(is_bool(config('docs.sidebar.footer', true))) + Back to home page + @else + {{ Hyde::markdown(config('docs.sidebar.footer')) }} + @endif

\ No newline at end of file diff --git a/packages/framework/tests/Feature/SidebarViewTest.php b/packages/framework/tests/Feature/SidebarViewTest.php index 53843c6ca74..44840e6440e 100644 --- a/packages/framework/tests/Feature/SidebarViewTest.php +++ b/packages/framework/tests/Feature/SidebarViewTest.php @@ -65,6 +65,17 @@ public function testBaseSidebarWithoutFooter() $this->assertViewWasNotRendered(view('hyde::components.docs.sidebar-footer-text')); } + public function testBaseSidebarWithCustomFooterText() + { + config(['docs.sidebar.footer' => 'My **Markdown** Footer Text']); + + $this->renderComponent(view('hyde::components.docs.sidebar')) + ->assertSeeHtml('