Skip to content

Commit

Permalink
Adds a customizable footer
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 21, 2022
1 parent ffb51c4 commit 09813cf
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
20 changes: 20 additions & 0 deletions app/Actions/ConvertsFooterMarkdown.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

namespace App\Actions;

use Illuminate\Support\Str;

class ConvertsFooterMarkdown
{
/**
* Convert the Markdown text if supplied in the config,
* or fall back to default to generate HTML for the footer.
*
* @return string $html
*/
public static function execute(): string
{
return Str::markdown(config('hyde.footer.markdown', 'Site built with the Free and Open Source [HydePHP](https://github.com/hydephp/hyde).
License [MIT](https://github.com/hydephp/hyde/blob/master/LICENSE.md).'));
}
}
33 changes: 27 additions & 6 deletions config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
| /___/
|--------------------------------------------------------------------------
|
| Welcome to HydePHP! In this file you can customize your new Static Site!
| Welcome to HydePHP! In this file, you can customize your new Static Site!
|
| HydePHP favors convention over configuration and as such requires virtually
| HydePHP favours convention over configuration and as such requires virtually
| no configuration out of the box to get started. Though, you may want to
| change the options to personalize your site and make it your own!
|
Expand All @@ -21,13 +21,13 @@

return [

/*
/*
|--------------------------------------------------------------------------
| Site Name
|--------------------------------------------------------------------------
|
| This value sets the name of your site and is, for example, used in
| the compiled page titles and more. Default value is "HydePHP".
| the compiled page titles and more. The default value is HydePHP.
|
*/

Expand All @@ -40,8 +40,8 @@
|--------------------------------------------------------------------------
|
| Some of Hyde's features are optional. Feel free to disable the features
| you don't need by removing them from this array or by commenting them.
| This type of configuration is directly inspired by Laravel Jetstream.
| you don't need by removing or commenting them out from this array.
| This config concept is directly inspired by Laravel Jetstream.
|
*/

Expand All @@ -53,6 +53,27 @@
],


/*
|--------------------------------------------------------------------------
| Footer Text
|--------------------------------------------------------------------------
|
| Most websites have a footer with copyright details and contact information.
| You probably want to change the Markdown to include your information,
| though you are of course welcome to keep the attribution link!
|
| You can also customize the blade view if you want a more complex footer.
| You can disable it completely by setting `enabled` to `false`.
|
*/

'footer' => [
'enabled' => true,
'markdown' => 'Site built with the Free and Open Source [HydePHP](https://github.com/hydephp/hyde).
License [MIT](https://github.com/hydephp/hyde/blob/master/LICENSE.md).'
],


/*
|--------------------------------------------------------------------------
| Custom Navigation Menu Links
Expand Down
4 changes: 2 additions & 2 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@

@include('layouts.meta')
</head>
<body id="app" class="overflow-x-hidden">
<body id="app" class="flex flex-col min-h-screen overflow-x-hidden">
@includeUnless($withoutNavigation ?? false, 'layouts.navigation')

<section id="content">
@yield('content')
</section>

@include('layouts.footer')
@includeWhen(config('hyde.footer.enabled', true), 'layouts.footer')
</body>
</html>
5 changes: 5 additions & 0 deletions resources/views/layouts/footer.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<footer class="py-4 px-6 w-full bg-slate-100 text-center mt-auto">
<div class="prose text-center mx-auto">
{!! App\Actions\ConvertsFooterMarkdown::execute() !!}
</div>
</footer>

0 comments on commit 09813cf

Please sign in to comment.