diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index e3d1b60364c..6bca2c46ffe 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -10,7 +10,8 @@ This serves two purposes:
2. At release time, you can move the Unreleased section changes into a new release version section.
### Added
-- for new features.
+- Added support for setting custom content when calling source file creator actions directly in https://github.com/hydephp/develop/pull/1393
+- Added support for setting a custom post date when calling post file creator action directly in https://github.com/hydephp/develop/pull/1393
### Changed
- for changes in existing functionality.
@@ -22,7 +23,10 @@ This serves two purposes:
- for now removed features.
### Fixed
-- for any bug fixes.
+- Catch RealtimeCompiler dashboard OutOfBoundsException in https://github.com/hydephp/develop/pull/1384
+- Updated dropdown navigation menus to support setting priority in config in https://github.com/hydephp/develop/pull/1387 (fixing https://github.com/hydephp/hyde/issues/229)
+- Updated the vendor publish command to support parent Laravel Prompts implementation in https://github.com/hydephp/develop/pull/1388
+- Fixed wrong version constant in https://github.com/hydephp/develop/pull/1391
### Security
- in case of vulnerabilities.
diff --git a/packages/framework/src/Framework/Actions/CreatesNewMarkdownPostFile.php b/packages/framework/src/Framework/Actions/CreatesNewMarkdownPostFile.php
index c59383eed74..3f1f4ea9625 100644
--- a/packages/framework/src/Framework/Actions/CreatesNewMarkdownPostFile.php
+++ b/packages/framework/src/Framework/Actions/CreatesNewMarkdownPostFile.php
@@ -7,10 +7,9 @@
use Hyde\Framework\Exceptions\FileConflictException;
use Hyde\Facades\Filesystem;
use Hyde\Pages\MarkdownPost;
+use Illuminate\Support\Carbon;
use Illuminate\Support\Str;
-use function date;
-
/**
* Offloads logic for the make:post command.
*
@@ -28,6 +27,7 @@ class CreatesNewMarkdownPostFile
protected string $author;
protected string $date;
protected string $identifier;
+ protected ?string $customContent;
/**
* Construct the class.
@@ -36,15 +36,18 @@ class CreatesNewMarkdownPostFile
* @param string|null $description The Post Meta Description.
* @param string|null $category The Primary Post Category.
* @param string|null $author The Username of the Author.
+ * @param string|null $date Optionally specify a custom date.
+ * @param string|null $customContent Optionally specify custom post content.
*/
- public function __construct(string $title, ?string $description, ?string $category, ?string $author)
+ public function __construct(string $title, ?string $description, ?string $category, ?string $author, ?string $date = null, ?string $customContent = null)
{
$this->title = $title;
$this->description = $description ?? 'A short description used in previews and SEO';
$this->category = $category ?? 'blog';
$this->author = $author ?? 'default';
+ $this->customContent = $customContent;
- $this->date = date('Y-m-d H:i');
+ $this->date = Carbon::make($date ?? Carbon::now())->format('Y-m-d H:i');
$this->identifier = Str::slug($title);
}
@@ -58,7 +61,7 @@ public function __construct(string $title, ?string $description, ?string $catego
*/
public function save(bool $force = false): string
{
- $page = new MarkdownPost($this->identifier, $this->toArray(), '## Write something awesome.');
+ $page = new MarkdownPost($this->identifier, $this->toArray(), $this->customContent ?? '## Write something awesome.');
if ($force !== true && Filesystem::exists($page->getSourcePath())) {
throw new FileConflictException($page->getSourcePath());
diff --git a/packages/framework/src/Framework/Actions/CreatesNewPageSourceFile.php b/packages/framework/src/Framework/Actions/CreatesNewPageSourceFile.php
index 13cf19b2fbc..60ff6686f92 100644
--- a/packages/framework/src/Framework/Actions/CreatesNewPageSourceFile.php
+++ b/packages/framework/src/Framework/Actions/CreatesNewPageSourceFile.php
@@ -13,6 +13,8 @@
use Hyde\Framework\Concerns\InteractsWithDirectories;
use Hyde\Framework\Exceptions\UnsupportedPageTypeException;
+use function trim;
+use function sprintf;
use function file_put_contents;
use function file_exists;
use function basename;
@@ -37,7 +39,9 @@ class CreatesNewPageSourceFile
protected string $subDir = '';
protected bool $force;
- public function __construct(string $title, string $pageClass = MarkdownPage::class, bool $force = false)
+ protected ?string $customContent;
+
+ public function __construct(string $title, string $pageClass = MarkdownPage::class, bool $force = false, ?string $customContent = null)
{
$this->validateType($pageClass);
$this->pageClass = $pageClass;
@@ -45,6 +49,7 @@ public function __construct(string $title, string $pageClass = MarkdownPage::cla
$this->title = $this->parseTitle($title);
$this->filename = $this->fileName($title);
$this->force = $force;
+ $this->customContent = $customContent;
$this->outputPath = $this->makeOutputPath($pageClass);
}
@@ -100,7 +105,7 @@ protected function createBladeFile(): void
@php(\$title = "$this->title")
$this->title
+ {$this->getBladePageContent()}