nav.ejs 1.28 KB
<!-- <nav class="navbar navbar-expand-sm navbar-light bg-light mb-3"> -->
<nav class="navbar navbar-expand-sm navbar-dark bg-dark mb-3">
    <div class="container">
      <div class="navbar-brand">Mapmory</div>
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent">
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav">
          <li class="nav-item"><a href="/" class="nav-link">Home</a></li>
          <li class="nav-item"><a href="/about" class="nav-link">About</a></li>
          <li class="nav-item"><a href="/posts" class="nav-link">Memory</a></li>
        </ul>

        <ul class="navbar-nav ml-auto">       <!-- 우측 정렬 -->
          <% if(isAuthenticated){ %>
            <li class="nav-item"><a href="/users/<%= currentUser.username %>" class="nav-link">My Account</a></li>
            <li class="nav-item"><a href="/logout" class="nav-link">Logout</a></li>
          <% } else { %>
            <li class="nav-item"><a href="/users/new" class="nav-link">Sign Up</a></li>
            <li class="nav-item"><a href="/login" class="nav-link">Login</a></li>
          <% } %>
        </ul>
      </div>
    </div>
  </nav>