From 800b0769ec96401060b2cd32e9573304ea92ccb4 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 5 Nov 2024 15:27:17 +0100 Subject: [PATCH 1/2] Add environment variable support for saving previews --- RELEASE_NOTES.md | 1 + config/hyde.php | 2 +- docs/extensions/realtime-compiler.md | 2 +- packages/framework/config/hyde.php | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d0468f9196e..43ff44ee7d8 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -22,6 +22,7 @@ This serves two purposes: - Introduced a new navigation config builder class to simplify navigation configuration in https://github.com/hydephp/develop/pull/1827 - You can now add custom posts to the blog post feed component when including it directly in https://github.com/hydephp/develop/pull/1893 - Added a `Feature::fromName()` enum helper in https://github.com/hydephp/develop/pull/1895 +- Added environment variable support for saving previews in https://github.com/hydephp/develop/pull/1996 - Added support for specifying features in the YAML configuration in https://github.com/hydephp/develop/pull/1896 - **Added a new consolidated Asset API to better handle media files.** - Added several new fluent methods to the `MediaFile` class, like `getLink()`, `getLength()`, `getMimeType()`, etc. diff --git a/config/hyde.php b/config/hyde.php index 010d9b26b11..4b4a74ce65e 100644 --- a/config/hyde.php +++ b/config/hyde.php @@ -423,7 +423,7 @@ 'host' => env('SERVER_HOST', 'localhost'), // Should preview pages be saved to the output directory? - 'save_preview' => false, + 'save_preview' => env('SERVER_SAVE_PREVIEW', false), // Should the live edit feature be enabled? 'live_edit' => env('SERVER_LIVE_EDIT', true), diff --git a/docs/extensions/realtime-compiler.md b/docs/extensions/realtime-compiler.md index 009e283ef04..534588803f7 100644 --- a/docs/extensions/realtime-compiler.md +++ b/docs/extensions/realtime-compiler.md @@ -31,7 +31,7 @@ The server can be configured in the `config/hyde.php` file to change the port, h 'server' => [ 'port' => env('SERVER_PORT', 8080), 'host' => env('SERVER_HOST', 'localhost'), - 'save_preview' => false, + 'save_preview' => env('SERVER_SAVE_PREVIEW', false), ], ``` diff --git a/packages/framework/config/hyde.php b/packages/framework/config/hyde.php index 010d9b26b11..4b4a74ce65e 100644 --- a/packages/framework/config/hyde.php +++ b/packages/framework/config/hyde.php @@ -423,7 +423,7 @@ 'host' => env('SERVER_HOST', 'localhost'), // Should preview pages be saved to the output directory? - 'save_preview' => false, + 'save_preview' => env('SERVER_SAVE_PREVIEW', false), // Should the live edit feature be enabled? 'live_edit' => env('SERVER_LIVE_EDIT', true), From 7a713a403881a5c00adf425a571b7ce2ad73ff7c Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 5 Nov 2024 15:28:38 +0100 Subject: [PATCH 2/2] Update RealtimeCompilerTest.php --- packages/realtime-compiler/tests/RealtimeCompilerTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/realtime-compiler/tests/RealtimeCompilerTest.php b/packages/realtime-compiler/tests/RealtimeCompilerTest.php index 45e78abd550..8ee16c74409 100644 --- a/packages/realtime-compiler/tests/RealtimeCompilerTest.php +++ b/packages/realtime-compiler/tests/RealtimeCompilerTest.php @@ -17,6 +17,7 @@ class RealtimeCompilerTest extends UnitTestCase public static function setUpBeforeClass(): void { putenv('SERVER_LIVE_EDIT=false'); + putenv('SERVER_SAVE_PREVIEW=true'); define('BASE_PATH', realpath(__DIR__.'/../../../'));