diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md
index e3d1b60364c..1b56f37fc74 100644
--- a/RELEASE_NOTES.md
+++ b/RELEASE_NOTES.md
@@ -13,7 +13,8 @@ This serves two purposes:
- for new features.
### Changed
-- for changes in existing functionality.
+- Renamed local template variable `$document` to `$article` to better match the usage in https://github.com/hydephp/develop/pull/1506
+- Updated semantic documentation article component to support existing variables in https://github.com/hydephp/develop/pull/1506
### Deprecated
- for soon-to-be removed features.
diff --git a/packages/framework/resources/views/components/docs/documentation-article.blade.php b/packages/framework/resources/views/components/docs/documentation-article.blade.php
index 1bacc9e5c42..328f370982d 100644
--- a/packages/framework/resources/views/components/docs/documentation-article.blade.php
+++ b/packages/framework/resources/views/components/docs/documentation-article.blade.php
@@ -1,20 +1,20 @@
@php
- $document = \Hyde\Framework\Features\Documentation\SemanticDocumentationArticle::make($page);
+ $article ??= \Hyde\Framework\Features\Documentation\SemanticDocumentationArticle::make($page);
@endphp
Hello world.
', $rendered); } + public function test_the_documentation_article_view_with_existing_variable() + { + $rendered = view('hyde::components.docs.documentation-article', [ + 'page' => $page = $this->makePage(), + 'article' => new class($page) extends SemanticDocumentationArticle + { + public function __construct(DocumentationPage $page) + { + parent::__construct($page); + } + + public function renderHeader(): HtmlString + { + return new HtmlString('Hello world.
', $rendered); + } + protected function makeArticle(string $sourceFileContents = "# Foo\n\nHello world."): SemanticDocumentationArticle { $this->file('_docs/foo.md', $sourceFileContents);