Small fixes in url generations
This commit is contained in:
parent
16f15ae2b2
commit
12739c2044
@ -40,7 +40,8 @@ class MarkdownPage extends \Todaymade\Daux\Format\Base\MarkdownPage
|
||||
$breadcrumb_trail = array();
|
||||
if (!empty($parents)) {
|
||||
foreach ($parents as $node) {
|
||||
$breadcrumb_trail[$node->getTitle()] = $node->getUrl();
|
||||
$page = $node->getIndexPage() ?: $node->getFirstPage();
|
||||
$breadcrumb_trail[$node->getTitle()] = $page? $page->getUrl() : '';
|
||||
}
|
||||
}
|
||||
return $breadcrumb_trail;
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use League\CommonMark\Environment;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Todaymade\Daux\Tree\Directory;
|
||||
use Todaymade\Daux\Tree\Root;
|
||||
|
||||
class Processor
|
||||
{
|
||||
@ -38,9 +38,9 @@ class Processor
|
||||
* the tree as you want, move pages, modify
|
||||
* pages and even add new ones.
|
||||
*
|
||||
* @param Directory $root
|
||||
* @param Root $root
|
||||
*/
|
||||
public function manipulateTree(Directory $root)
|
||||
public function manipulateTree(Root $root)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -145,8 +145,10 @@ class Builder
|
||||
*/
|
||||
public static function getOrCreatePage(Directory $parent, $title)
|
||||
{
|
||||
$slug = DauxHelper::slug($title);
|
||||
$uri = $slug = DauxHelper::slug($title);
|
||||
if ($parent->getConfig()['mode'] === Daux::STATIC_MODE) {
|
||||
$uri = $slug . ".html";
|
||||
}
|
||||
|
||||
if (array_key_exists($uri, $parent->getEntries())) {
|
||||
return $parent->getEntries()[$uri];
|
||||
|
Loading…
Reference in New Issue
Block a user