diff --git a/config/docs.php b/config/docs.php index fe9cf452..fab400e9 100644 --- a/config/docs.php +++ b/config/docs.php @@ -30,7 +30,8 @@ // When using a grouped sidebar, should the groups be collapsible? 'collapsible' => true, - // Should the sidebar footer be shown? + // Should the sidebar footer be shown? You can also set this to a string + // of Markdown to show in the footer. Set to `false` to disable. 'footer' => true, ], diff --git a/resources/views/components/docs/sidebar-footer-text.blade.php b/resources/views/components/docs/sidebar-footer-text.blade.php index 4bafb848..6b49ca39 100644 --- a/resources/views/components/docs/sidebar-footer-text.blade.php +++ b/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/resources/views/components/docs/sidebar.blade.php b/resources/views/components/docs/sidebar.blade.php index 9d8872bc..04b9857a 100644 --- a/resources/views/components/docs/sidebar.blade.php +++ b/resources/views/components/docs/sidebar.blade.php @@ -7,7 +7,7 @@ 'sidebar' => \Hyde\Framework\Features\Navigation\DocumentationSidebar::create(), ]) - @if(config('docs.sidebar.footer', true)) + @if(config('docs.sidebar.footer', true) !== false) diff --git a/tests/Feature/SidebarViewTest.php b/tests/Feature/SidebarViewTest.php index 53843c6c..44840e64 100644 --- a/tests/Feature/SidebarViewTest.php +++ b/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('