<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
  <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
  <link rel="stylesheet" href="../public/css/style.css">
  <title>Halaman Beranda</title>
</head>
<body>
  <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
    <a class="navbar-brand" href="#">Beranda</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNav">
      <ul class="navbar-nav">
        <li class="nav-item active">
          <a class="nav-link" href="#">Tentang Kami <span class="sr-only">(current)</span></a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#">Kontak</a>
        </li>
      </ul>
    </div>
  </nav>

  <div class="container">
    <div class="jumbotron">
      <h1 class="display-4">Selamat datang di Blog Sederhana</h1>
      <p class="lead">Ini adalah blog sederhana untuk berbagi informasi dan cerita menarik.</p>
      <hr class="my-4">
      <p>Temukan postingan terbaru dan cerita menarik di sini.</p>
      <a class="btn btn-primary btn-lg" href="#" role="button">Lihat Postingan</a>
    </div>

    <h2>Daftar Posting:</h2>

    <div class="row">
      <% posts.forEach(post => { %>
        <div class="col-md-4">
          <div class="card mb-4">
            <div class="card-body">
              <h5 class="card-title"><%= post.title %></h5>
              <p class="card-text"><%= post.content %></p>
              <a href="#" class="btn btn-primary">Baca Selengkapnya</a>
            </div>
          </div>
        </div>
      <% }); %>
    </div>
  </div>

  <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js"></script>
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>
