Skip to content

Commit

Permalink
update: Navigation logic for deeper pages
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbruce committed Feb 23, 2024
1 parent 93b9e17 commit 581a89d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions site-root/public/foot.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
<nav>
<ul>
<?php foreach ($navigation as $href => $linkText) {
if ($uri === $href) {
print('<li><span>' . $linkText . '</li>');
if (
($uri !== '/' and $href === '/') or
str_starts_with($uri, $href) === false
) {
print('<li><a '. $class . 'href="' . $href . '">' . $linkText . '</a></li>');

} else {
print('<li><a '. $class . 'href="' . $href . '">' . $linkText . '</a></li>');
print('<li><span>' . $linkText . '</li>');

}
} ?>
Expand Down
2 changes: 1 addition & 1 deletion site-root/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<h2 id="time">Time</h2>
<p>Create or upgrade your time management system.</p>
<p><a href="/booking/">Schedule<br>free consultation</a></p>
<p><a href="https://leanpub.com/master-the-mundane">Sign up for<br>book notifications</a></p>
<p><a href="/books/time-mastering-the-mundane/">The book</a></p>
</section>
<section>
<h2 id="space">Space</h2>
Expand Down

0 comments on commit 581a89d

Please sign in to comment.