Skip to content

Commit

Permalink
Use the new Navigation configuration builder class
Browse files Browse the repository at this point in the history
Updates the configuration files to use the new Navigation configuration builder
  • Loading branch information
caendesilva committed Jul 11, 2024
1 parent ea05a98 commit 57b7035
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 54 deletions.
42 changes: 15 additions & 27 deletions config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,40 +332,28 @@
|
*/

'navigation' => [
// This configuration sets the priorities used to determine the order of the menu.
// The default values have been added below for reference and easy editing.
// The array key is the page's route key, the value is the priority.
// Lower values show up first in the menu. The default is 999.
'order' => [
'navigation' => Navigation::configure()
->order([
// Override page priority order
'index' => 0,
'posts' => 10,
'docs/index' => 100,
],

// In case you want to customize the labels for the menu items, you can do so here.
// Simply add the route key as the array key, and the label as the value.
'labels' => [
])
->labels([
// Override page labels
'index' => 'Home',
'docs/index' => 'Docs',
],

// These are the route keys of pages that should not show up in the navigation menu.
'exclude' => [
])
->exclude([
// Exclude pages from the navigation
'404',
],

// Any extra links you want to add to the navigation menu can be added here.
// To get started quickly, you can uncomment the defaults here.
// See the documentation link above for more information.
'custom' => [
])
->custom([
// Add custom items to the navigation menu
// Navigation::item('https://github.com/hydephp/hyde', 'GitHub', 200),
],

// How should pages in subdirectories be displayed in the menu?
// You can choose between 'dropdown', 'flat', and 'hidden'.
'subdirectory_display' => 'hidden',
],
])
// Configure how subdirectories are displayed in the navigation
->subdirectoryDisplay('hidden'),

/*
|--------------------------------------------------------------------------
Expand Down
42 changes: 15 additions & 27 deletions packages/framework/config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,40 +332,28 @@
|
*/

'navigation' => [
// This configuration sets the priorities used to determine the order of the menu.
// The default values have been added below for reference and easy editing.
// The array key is the page's route key, the value is the priority.
// Lower values show up first in the menu. The default is 999.
'order' => [
'navigation' => Navigation::configure()
->order([
// Override page priority order
'index' => 0,
'posts' => 10,
'docs/index' => 100,
],

// In case you want to customize the labels for the menu items, you can do so here.
// Simply add the route key as the array key, and the label as the value.
'labels' => [
])
->labels([
// Override page labels
'index' => 'Home',
'docs/index' => 'Docs',
],

// These are the route keys of pages that should not show up in the navigation menu.
'exclude' => [
])
->exclude([
// Exclude pages from the navigation
'404',
],

// Any extra links you want to add to the navigation menu can be added here.
// To get started quickly, you can uncomment the defaults here.
// See the documentation link above for more information.
'custom' => [
])
->custom([
// Add custom items to the navigation menu
// Navigation::item('https://github.com/hydephp/hyde', 'GitHub', 200),
],

// How should pages in subdirectories be displayed in the menu?
// You can choose between 'dropdown', 'flat', and 'hidden'.
'subdirectory_display' => 'hidden',
],
])
// Configure how subdirectories are displayed in the navigation
->subdirectoryDisplay('hidden'),

/*
|--------------------------------------------------------------------------
Expand Down

0 comments on commit 57b7035

Please sign in to comment.