Skip to content

Commit

Permalink
feat(navbar): Remove navigation menu links we're not using and make a…
Browse files Browse the repository at this point in the history
…ll links relative to root site directory and without any .html extension
  • Loading branch information
victorkane committed Jun 4, 2020
1 parent a2aeb78 commit 72b5c0c
Show file tree
Hide file tree
Showing 5 changed files with 451 additions and 538 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ In the introductory [Eleventy (11ty) Static HTML Theme Conversion Introduction](
- Make sure `src` and `href` links take the path from site document root. Example:
From: `<script src="assets/js/jquery-2.2.4.min.js"></script>`
To: `<script src="/assets/js/jquery-2.2.4.min.js"></script>`
- Each page works if we go there directly... But if we go to the home page, the navigation to `About`, for example
- Each page works if we invoke them directly (as in `http://localhost:8080/testimonial/`).
But if we go to the home page, the navigation to `About`, for example,
doesn't work (link is http://localhost:8080/about.html) and we get an error: `Cannot GET /about.html`.
- Edit the base template and
- Remove links we're not using
- Correct links by making them relative to root and without the `.html` extension
## Reusable Content Template
Expand Down
35 changes: 7 additions & 28 deletions src/includes/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="container">
<div class="row">
<div class="col-6 col-sm-3 logo-column">
<a href="index.html" class="logo">
<a href="/" class="logo">
<img src="/assets/img/logo.png" alt="logo">
</a>
</div>
Expand All @@ -49,33 +49,12 @@
</div>
<nav id="menu" class="d-none d-lg-block">
<ul>
<li class="current-menu-item has-child">
<a href="index.html">Home</a>
<ul class="sub-menu">
<li><a href="index.html">Home - 01</a></li>
<li><a href="index-2.html">Home - 02</a></li>
<li><a href="index-3.html">Home - 03</a></li>
</ul>
</li>
<li><a href="about.html">About</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li class="has-child">
<a href="#">Pages</a>
<ul class="sub-menu">
<li><a href="404.html">404</a></li>
<li><a href="about.html">About</a></li>
<li><a href="career.html">Career</a></li>
<li><a href="coming-soon.html">Coming Soon</a></li>
<li><a href="contact.html">Contact</a></li>
<li><a href="faq.html">Faq</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="pricing.html">Pricing</a></li>
<li><a href="service.html">Service</a></li>
<li><a href="team.html">Team</a></li>
<li><a href="testimonial.html">Testimonial</a></li>
</ul>
</li>
<li><a href="contact.html">Contact</a></li>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
<!-- <li><a href="/404">404</a></li> -->
<li><a href="/services">Services</a></li>
<li><a href="/testimonials">Testimonials</a></li>
<li><a href="/contact">Contact</a></li>
</ul>
</nav>
</div>
Expand Down
Loading

0 comments on commit 72b5c0c

Please sign in to comment.