Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated DocumentationPage::getDocumentationOutputPath() #165

Merged
merged 3 commits into from
Jul 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This serves two purposes:
### Removed
- Remove deprecated `Hyde::getDocumentationOutputDirectory()`, replaced with `DocumentationPage::getOutputDirectory()`
- Remove deprecated `Hyde::docsIndexPath()`, replaced with `DocumentationPage::indexPath()`
- Remove deprecated `DocumentationPage::getDocumentationOutputPath()`, use `DocumentationPage::getOutputPath()` instead


### Fixed
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/src/HydeServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function register(): void
BladePage::class => '',
MarkdownPage::class => '',
MarkdownPost::class => 'posts',
DocumentationPage::class => config('docs.output_directory', 'docs'),
DocumentationPage::class => unslash(config('docs.output_directory', 'docs')),
]);

$this->storeCompiledSiteIn(Hyde::path(
Expand Down
8 changes: 0 additions & 8 deletions packages/framework/src/Models/Pages/DocumentationPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ public function getOnlineSourcePath(): string|false
return trim(config('docs.source_file_location_base'), '/').'/'.$this->slug.'.md';
}

/**
* @deprecated v0.44.x Use DocumentationPage::getOutputDirectory() instead
*/
public static function getDocumentationOutputPath(): string
{
return unslash(config('docs.output_directory', 'docs'));
}

/**
* Get the path to the frontpage for the documentation.
*
Expand Down
6 changes: 3 additions & 3 deletions packages/framework/tests/Unit/DocumentationPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public function test_can_get_online_source_path_with_trailing_slash()

public function test_can_get_documentation_output_path()
{
$this->assertEquals('docs', DocumentationPage::getDocumentationOutputPath());
$this->assertEquals('docs', DocumentationPage::getOutputDirectory());
}

public function test_can_get_documentation_output_path_with_custom_output_directory()
{
config(['docs.output_directory' => 'foo']);
(new HydeServiceProvider($this->app))->register();
$this->assertEquals('foo', DocumentationPage::getDocumentationOutputPath());
$this->assertEquals('foo', DocumentationPage::getOutputDirectory());
}

public function test_can_get_documentation_output_path_with_trailing_slashes()
Expand All @@ -76,7 +76,7 @@ public function test_can_get_documentation_output_path_with_trailing_slashes()
foreach ($tests as $test) {
config(['docs.output_directory' => $test]);
(new HydeServiceProvider($this->app))->register();
$this->assertEquals('foo', DocumentationPage::getDocumentationOutputPath());
$this->assertEquals('foo', DocumentationPage::getOutputDirectory());
}
}
}