Hello there, I'm encountering an issue with my navbar in an express app. The navbar is saved as a partial and included in a boilerplate wrapper used on most pages. Here's a snippet of how it looks:
<h1>HELLO<h1>
Within the boilerplate file, I've included the navbar like this:
<%- include("../partials/navbar")%>
The problem arises when the two .svg images don't display on certain pages, even though they are formatted exactly the same. Any thoughts on what might be causing this?
Please bear with me as I am fairly new to coding, so if you need clarification or have suggestions, feel free to share them!
Thank you in advance for your help!
EDIT (lack of information):
Here's the code for the navbar partial:
<nav class="navbar navbar-expand-md sticky-top navbar-dark">
<a href="/"> <img class="brand" src="logo.svg" alt="" /></a>
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="navbar-nav">
<a class="nav-link ms-3" href="/events">Upcoming Events</a>
<a class="nav-link ms-3" href="/events/new">New Event</a>
<a class="nav-link ms-3" href="/community">Community</a>
</div>
<div class="navbar-nav ml-auto rightLinks" id="navbarSupportedContent">
<% if(!currentUser) { %>
<p><%= currentUser %></p>
<a class="nav-link" href="/login">Login</a>
<a class="nav-link" href="/register">Register</a>
<% } else { %>
<a class="nav-link" href="/logout">Logout</a>
<p class="nav-link">
<%=currentUser.username %><img class="profileIcon" src="profile.svg"></img>
</p>
<% } %>
</div>
</div>
</div>
</nav>
And here's the boilerplate code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="/style2.css" />
<link rel="icon" href="/favicon.ico" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Anton&display=swap"
rel="stylesheet"
/>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap"
rel="stylesheet"
/>
<script src="https://api.mapbox.com/mapbox-gl-js/v2.0.1/mapbox-gl.js"></script>
<link
href="https://api.mapbox.com/mapbox-gl-js/v2.0.1/mapbox-gl.css"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn538...
If it helps, all affected pages and images are in the same directory within the public folder.
Each file starts with <% layout("layouts/boilerplate") %>, yet only displays the images on specific pages.