Skip to content

Commit a2efff8

Browse files
authored
Merge pull request #1897 from hydephp/group-together-dynamic-pages-in-build
[2.x] Update the build service to group together dynamic pages
2 parents 2a97871 + cf0bfc8 commit a2efff8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ This serves two purposes:
5656
- Markdown returned from includes are now trimmed of trailing whitespace and newlines in https://github.com/hydephp/develop/pull/1738
5757
- Reorganized and cleaned up the navigation and sidebar documentation for improved clarity.
5858
- Moved the sidebar documentation to the documentation pages section for better organization.
59+
- The build command now groups together all `InMemoryPage` instances under one progress bar group in https://github.com/hydephp/develop/pull/1897
5960

6061
### Deprecated
6162
- for soon-to-be removed features.

packages/framework/src/Framework/Services/BuildService.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Hyde\Framework\Services;
66

77
use Hyde\Hyde;
8+
use Hyde\Pages\InMemoryPage;
89
use Hyde\Foundation\Facades\Routes;
910
use Hyde\Foundation\Kernel\RouteCollection;
1011
use Hyde\Framework\Actions\StaticPageBuilder;
@@ -62,13 +63,21 @@ protected function compilePagesForClass(string $pageClass): void
6263

6364
protected function getClassPluralName(string $pageClass): string
6465
{
66+
if ($pageClass === InMemoryPage::class) {
67+
return 'Dynamic Pages';
68+
}
69+
6570
return preg_replace('/([a-z])([A-Z])/', '$1 $2', class_basename($pageClass)).'s';
6671
}
6772

6873
/** @return array<class-string<\Hyde\Pages\Concerns\HydePage>> */
6974
protected function getPageTypes(): array
7075
{
7176
return Hyde::pages()->map(function (HydePage $page): string {
77+
if ($page instanceof InMemoryPage) {
78+
return InMemoryPage::class;
79+
}
80+
7281
return $page::class;
7382
})->unique()->values()->toArray();
7483
}

0 commit comments

Comments
 (0)