Skip to content

Commit

Permalink
[#72] Skip parts kit index file
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuapease committed Dec 13, 2023
1 parent f4e0b6c commit 1f7765b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/services/PartsKit.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,24 @@ public static function getNav(): array
...$files
];

sort($templates);
$skipPaths = [
$partsPath . 'index.twig',
$partsPath . 'index.html',
];

sort($templates);

/** @var NavNode[] $result */
$result = [];
// Loop through all the paths in the folder.
// Creating a NavNode object and putting the path to each node in the map.
foreach ($templates as $templatePath) {

// Skip ignored paths
if (in_array($templatePath, $skipPaths)) {
continue;
}

$path = str_replace($partsPath, '', $templatePath);
$pathParts = explode('/', $path);
$title = self::_formatTitle(end($pathParts));
Expand Down

0 comments on commit 1f7765b

Please sign in to comment.