diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e559b36c14d..87ce80e3e63 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -20,9 +20,10 @@ This update makes breaking changes to the configuration. You will need to update - Moved config option `hyde.output_directory` to `site.output_directory` - The default `site.url` is now `http://localhost` instead of `null` +- Merged configuration options for the footer, see below ### Deprecated -- for soon-to-be removed features. +- Deprecate ConvertsFooterMarkdown.php ### Removed - Removed `\Hyde\Framework\Facades\Route`. You can swap out usages with `\Hyde\Framework\Models\Route` without side effects. @@ -38,6 +39,8 @@ This update makes breaking changes to the configuration. You will need to update ### Upgrade Guide +#### Using the new site config + Site-specific config options have been moved from `config/hyde.php` to `config/site.php`. The Hyde config is now used to configure behaviour of the site, while the site config is used to customize the look and feel, the presentation, of the site. The following configuration options have been moved. The actual usages remain the same, so you can upgrade by using copying over these options to the new file. @@ -49,4 +52,28 @@ The following configuration options have been moved. The actual usages remain th - `hyde.language` - `hyde.output_directory` -If you have published and Blade views or written custom code that uses the config options, you may need to update them. You can do this by republishing the Blade views, and/or using search and replace across your code. VSCode has a useful feature to make this a breeze: `CMD/CTRL+Shift+F`. \ No newline at end of file +If you have published and Blade views or written custom code that uses the config options, you may need to update them. You can do this by republishing the Blade views, and/or using search and replace across your code. VSCode has a useful feature to make this a breeze: `CMD/CTRL+Shift+F`. + +#### Using the new footer config + +The footer configuration options have been merged. Prior to this update, the config option looked as follows: +```php +// filepath: config/hyde.php +'footer' => [ + 'enabled' => true, + 'markdown' => 'Markdown text...' +], +``` + +Now, the config option looks as follows: +```php +// filepath: config/hyde.php + +// To use Markdown text +'footer' => 'Markdown text...', + +// To disable it completely +'footer' => false, +``` + +As you can see, the new config option is a string or the boolean false instead of an array. We use the same option for both the Markdown text and the footer disabled state. diff --git a/config/hyde.php b/config/hyde.php index 4099605cda5..bb28df6dec0 100644 --- a/config/hyde.php +++ b/config/hyde.php @@ -97,19 +97,18 @@ | 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! + | Here you can customize the footer Markdown text for your site. | - | You can also customize the blade view if you want a more complex footer. - | You can disable it completely by setting `enabled` to `false`. + | If you don't want to write Markdown here, you use a Markdown include. + | You can also customize the Blade view if you want a more complex footer. + | You can disable it completely by changing the setting to `false`. + | + | To read about the many configuration options here, visit: + | https://hydephp.com/docs/master/customization#footer | */ - 'footer' => [ - 'enabled' => true, - 'markdown' => 'Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩', - ], + 'footer' => 'Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩', /* |-------------------------------------------------------------------------- diff --git a/docs/customization.md b/docs/customization.md index a23309cc1b2..940692b6394 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -113,14 +113,42 @@ author: mr_hyde ``` ### Footer -The footer can be customized using Markdown, and even disabled completely. + +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 default attribution link! + +The footer component is made up of a few levels of components, depending on how much you want to customize. + +#### Customizing the Markdown text + +There are two ways to customize the footer text. First, you can set it in the configuration file: ```php -// torchlight! {"lineNumbers": false} -'footer' => [ - 'enabled' => true, - 'markdown' => 'Site built with [HydePHP](https://github.com/hydephp/hyde).' -], +// filepath: config/hyde.php +'footer' => 'Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩', +``` + +If you don't want to write Markdown in the configuration file, you can create a Markdown file in your includes directory. When this file is found, it will be used instead of the configuration setting. + +```markdown +// filepath: resources/_includes/footer.md +Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩 +``` + +In both cases the parsed Markdown will be rendered in the footer Blade component. + +#### Customizing the Blade component + +The actual footer component is rendered using the [`layouts/footer.blade.php`](https://github.com/hydephp/framework/blob/master/resources/views/layouts/footer.blade.php) Blade template. + +In this template we automatically render the configured footer Markdown text. If you want to change this behaviour, for example, HydePHP.com uses a more sophisticated footer, simply [publish the footer component](#blade-views). + +#### Disabling the footer entirely + +If you don't want to have a footer on your site, you can set the `'footer'` configuration option to `false`. + +```php +// filepath: config/hyde.php +'footer' => 'false', ``` ### Navigation Menu & Sidebar diff --git a/packages/framework/config/hyde.php b/packages/framework/config/hyde.php index 4099605cda5..bb28df6dec0 100644 --- a/packages/framework/config/hyde.php +++ b/packages/framework/config/hyde.php @@ -97,19 +97,18 @@ | 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! + | Here you can customize the footer Markdown text for your site. | - | You can also customize the blade view if you want a more complex footer. - | You can disable it completely by setting `enabled` to `false`. + | If you don't want to write Markdown here, you use a Markdown include. + | You can also customize the Blade view if you want a more complex footer. + | You can disable it completely by changing the setting to `false`. + | + | To read about the many configuration options here, visit: + | https://hydephp.com/docs/master/customization#footer | */ - 'footer' => [ - 'enabled' => true, - 'markdown' => 'Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩', - ], + 'footer' => 'Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩', /* |-------------------------------------------------------------------------- diff --git a/packages/framework/resources/views/layouts/app.blade.php b/packages/framework/resources/views/layouts/app.blade.php index d53343bf4cb..57b672338db 100644 --- a/packages/framework/resources/views/layouts/app.blade.php +++ b/packages/framework/resources/views/layouts/app.blade.php @@ -11,7 +11,7 @@ @yield('content') - @includeWhen(config('hyde.footer.enabled', true), 'hyde::layouts.footer') + @include('hyde::layouts.footer') @include('hyde::layouts.scripts') diff --git a/packages/framework/resources/views/layouts/footer.blade.php b/packages/framework/resources/views/layouts/footer.blade.php index 1c50b80505c..7a1b1e9257e 100644 --- a/packages/framework/resources/views/layouts/footer.blade.php +++ b/packages/framework/resources/views/layouts/footer.blade.php @@ -1,6 +1,8 @@ +@if(config('hyde.footer') !== false) +@endif diff --git a/packages/framework/src/Actions/ConvertsFooterMarkdown.php b/packages/framework/src/Actions/ConvertsFooterMarkdown.php index 28afa0df705..d1ecb2e517e 100644 --- a/packages/framework/src/Actions/ConvertsFooterMarkdown.php +++ b/packages/framework/src/Actions/ConvertsFooterMarkdown.php @@ -11,6 +11,7 @@ * otherwise, it falls back to a default string. * * @see \Hyde\Framework\Testing\Unit\ConvertsFooterMarkdownTest + * @deprecated v0.50.x */ class ConvertsFooterMarkdown {