Skip to content

Commit 7794cea

Browse files
committed
Better navigation (issue #5)
1 parent 052a229 commit 7794cea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/PHPDraft/Out/HTML/default.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@
5252
<ul class="list-unstyled">
5353
<?php foreach ($category->children as $resource): ?>
5454
<li>
55-
<a href="#<?= $resource->get_href(); ?>"><?= $resource->title; ?></a>
55+
<a href="#<?= str_replace('-', '/', $resource->get_href()); ?>"><?= $resource->title; ?></a>
5656
</li>
5757
<ul>
5858
<?php foreach ($resource->children as $transition): ?>
5959
<li>
60-
<a href="#<?= $transition->get_href(); ?>">
60+
<a href="#<?= str_replace('-', '/', $transition->get_href()); ?>">
6161
<?= $transition->title; ?>
6262
<span
6363
class="pull-right <?= $this->get_method_icon($transition->get_method()); ?>"></span>
@@ -109,7 +109,7 @@ class="pull-right <?= $this->get_method_icon($transition->get_method()); ?>"></s
109109
<?php endif;?>
110110
<?php foreach ($category->children as $resource): ?>
111111
<h3>
112-
<a id="<?= $resource->get_href(); ?>"><?= $resource->title; ?></a>
112+
<a id="<?= str_replace('-', '/', $resource->get_href()); ?>"><?= $resource->title; ?></a>
113113
<small><?= $resource->href; ?></small>
114114
</h3>
115115
<p><?php $resource->description; ?></p>
@@ -121,7 +121,7 @@ class="panel panel-default <?= $transition->get_method(); ?>">
121121
<var><?= $transition->get_method(); ?></var>
122122
<code><?= $transition->href; ?></code>
123123
<a class="pull-right transition-title"
124-
id="<?= $transition->get_href(); ?>"><?= $transition->title; ?></a>
124+
id="<?= str_replace('-', '/', $transition->get_href()); ?>"><?= $transition->title; ?></a>
125125
</h3>
126126
</div>
127127
<div class="panel-body">

0 commit comments

Comments
 (0)