diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 01955fff841..1c7e3aa81e5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -12,15 +12,15 @@ This serves two purposes: ### Added - Added a new `\Hyde\Framework\Actions\PreBuildTasks\TransferMediaAssets` build task handle media assets transfers for site builds. - Added a new `ExternalRoute` class to represent external routes. -- Added a new `NavItem::getLink()` method contain the previous `NavItem::getDestination()` logic, to return the link URL. +- Added a new `NavigationItem::getLink()` method contain the previous `NavigationItem::getDestination()` logic, to return the link URL. ### Changed - Changed how the documentation search is generated, to be an `InMemoryPage` instead of a post-build task. - Media asset files are now copied using the new build task instead of the deprecated `BuildService::transferMediaAssets()` method. - Minor: The documentation article component now supports disabling the semantic rendering using a falsy value in https://github.com/hydephp/develop/pull/1566 - Navigation menu items are now no longer filtered by duplicates (meaning two items with the same label can now exist in the same menu) in https://github.com/hydephp/develop/pull/1573 -- Breaking: The `NavItem` class now always stores the destination as a `Route` instance. -- Breaking: The `NavItem::getDestination()` method now returns its `Route` instance. +- Breaking: The `NavigationItem` class now always stores the destination as a `Route` instance. +- Breaking: The `NavigationItem::getDestination()` method now returns its `Route` instance. ### Deprecated - for soon-to-be removed features. @@ -63,11 +63,11 @@ For more information, see https://github.com/hydephp/develop/pull/1498. ### Navigation item changes -The `NavItem::getDestination()` method now returns its `Route` instance. This allows for deferring the route evaluation. +The `NavigationItem::getDestination()` method now returns its `Route` instance. This allows for deferring the route evaluation. If you have previously used this method directly and expected a string to be returned, you may need to adapt your code to handle the new return type. -If you want to retain the previous state where a string is always returned, you can use the new `NavItem::getLink()` method instead, which will resolve the route immediately. +If you want to retain the previous state where a string is always returned, you can use the new `NavigationItem::getLink()` method instead, which will resolve the route immediately. ### HTML ID changes diff --git a/config/hyde.php b/config/hyde.php index 9cbbe1cceb3..65fa6d4394f 100644 --- a/config/hyde.php +++ b/config/hyde.php @@ -350,7 +350,7 @@ // To get started quickly, you can uncomment the defaults here. // See the documentation link above for more information. 'custom' => [ - // NavItem::forLink('https://github.com/hydephp/hyde', 'GitHub', 200), + // NavigationItem::forLink('https://github.com/hydephp/hyde', 'GitHub', 200), ], // How should pages in subdirectories be displayed in the menu? diff --git a/docs/digging-deeper/navigation.md b/docs/digging-deeper/navigation.md index f36a2f9a761..761506488f2 100644 --- a/docs/digging-deeper/navigation.md +++ b/docs/digging-deeper/navigation.md @@ -230,18 +230,18 @@ To remove items from being automatically added, simply add the page's route key ### Adding Custom Navigation Menu Links -You can easily add custom navigation menu links similar to how we add Authors. Simply add a `NavItem` model to the `navigation.custom` array. +You can easily add custom navigation menu links similar to how we add Authors. Simply add a `NavigationItem` model to the `navigation.custom` array. -When linking to an external site, you should use the `NavItem::forLink()` method facade. The first two arguments are the +When linking to an external site, you should use the `NavigationItem::forLink()` method facade. The first two arguments are the destination and label, both required. The third argument is the priority, which is optional, and defaults to `500`. ```php // filepath config/hyde.php -use Hyde\Framework\Features\Navigation\NavItem; +use Hyde\Framework\Features\Navigation\NavigationItem; 'navigation' => [ 'custom' => [ - NavItem::forLink('https://github.com/hydephp/hyde', 'GitHub', 200), + NavigationItem::forLink('https://github.com/hydephp/hyde', 'GitHub', 200), ] ] ``` @@ -314,14 +314,14 @@ use Hyde\Framework\Features\Navigation\BaseNavigationMenu; Within the `BaseNavigationMenu` class, you will find the main logic for how the menus are generated, while the child implementations contain the extra logic tailored for their specific use cases. -All the navigation menus store the menu items in their `$items` array containing instances of the `NavItem` class. +All the navigation menus store the menu items in their `$items` array containing instances of the `NavigationItem` class. -The `NavItem` class is a simple class that contains the label and URL of the menu item and is used to represent each item in the menu. -Dropdowns are represented by `DropdownNavItem` instances, which extend the `NavItem` class and contain an array of additional `NavItem` instances. +The `NavigationItem` class is a simple class that contains the label and URL of the menu item and is used to represent each item in the menu. +Dropdowns are represented by `DropdownNavigationItem` instances, which extend the `NavigationItem` class and contain an array of additional `NavigationItem` instances. ```php -use Hyde\Framework\Features\Navigation\NavItem; -use Hyde\Framework\Features\Navigation\DropdownNavItem; +use Hyde\Framework\Features\Navigation\NavigationItem; +use Hyde\Framework\Features\Navigation\DropdownNavigationItem; ``` ## The Navigation API diff --git a/packages/framework/config/hyde.php b/packages/framework/config/hyde.php index 9cbbe1cceb3..65fa6d4394f 100644 --- a/packages/framework/config/hyde.php +++ b/packages/framework/config/hyde.php @@ -350,7 +350,7 @@ // To get started quickly, you can uncomment the defaults here. // See the documentation link above for more information. 'custom' => [ - // NavItem::forLink('https://github.com/hydephp/hyde', 'GitHub', 200), + // NavigationItem::forLink('https://github.com/hydephp/hyde', 'GitHub', 200), ], // How should pages in subdirectories be displayed in the menu? diff --git a/packages/framework/resources/views/components/docs/sidebar-items.blade.php b/packages/framework/resources/views/components/docs/sidebar-items.blade.php index f0d4cb553f0..ee8bdfc4fbd 100644 --- a/packages/framework/resources/views/components/docs/sidebar-items.blade.php +++ b/packages/framework/resources/views/components/docs/sidebar-items.blade.php @@ -6,7 +6,7 @@ @else