Skip to content

Commit 4bb9ec3

Browse files
Update
1 parent 549f831 commit 4bb9ec3

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

about.page

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ images:
77
- /lot/y/normal/index/1.png
88
author: Taufik Nurrohman
99
type: Markdown
10-
version: 2.13.0
10+
version: 2.13.1
1111
...
1212

1313
This is the default layout used by Mecha version `1.x.x`.

index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
lot('links', $links = new Anemone((static function ($links, $state, $url) {
44
$index = LOT . D . 'page' . D . trim(strtr($state->route ?? 'index', '/', D), D) . '.page';
5-
$path = $url->path . '/';
5+
$route = $url->path . '/';
66
foreach (g(LOT . D . 'page', 'page') as $k => $v) {
77
// Exclude home page
88
if ($k === $index) {
99
continue;
1010
}
1111
$v = new Page($k);
1212
// Add current state
13-
$v->current = 0 === strpos($path, '/' . $v->name . '/');
13+
$v->current = 0 === strpos($route, $v->route . '/');
1414
$links[$k] = $v;
1515
}
1616
ksort($links);

nav.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
</a>
77
</li>
88
<?php foreach ($links as $link): ?>
9+
<?php $children = $link->children ?? false; ?>
910
<li<?= $link->current ? ' class="current"' : ""; ?>>
10-
<a href="<?= eat($link->link ?? $link->url); ?>">
11+
<a href="<?= eat($link->link ?? ($link->url . ($children && $children->count ? '/1' : ""))); ?>">
1112
<?= $link->title; ?>
1213
</a>
1314
</li>

0 commit comments

Comments
 (0)