Skip to content

Commit

Permalink
feat: allow skipping some routes when generating the site (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi authored Jan 6, 2022
1 parent 725034a commit 760a9d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Bridge/Symfony/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public function getConfigTreeBuilder(): TreeBuilder
->isRequired()
->cannotBeEmpty()
->end()
->booleanNode('skip')
->defaultFalse()
->end()
->variableNode('defaults')
->end()
->variableNode('catalog')
Expand Down
4 changes: 4 additions & 0 deletions src/Permutator.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ public function __construct(array $routes, Database $database)
public function permute(): iterable
{
foreach ($this->routes as $route => $spec) {
if ($spec['skip']) {
continue;
}

$variables = [];
if ( ! isset($spec['catalog'])) {
yield $route => $spec['defaults'] ?? [];
Expand Down

0 comments on commit 760a9d2

Please sign in to comment.