-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
56 lines (47 loc) · 1.81 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
require './functions.php';
$posts = getPosts(limit: 4);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php require './partials/head.php'; ?>
<title>Home | Blogu</title>
</head>
<body>
<?php require './partials/navbar.php' ?>
<div class="hero flex ai-c">
<div class="container text-center">
<h1 class="title mb-2">Improve your knowledge with <span class="text-primary">Blogu.</span></h1>
<p class="mx-auto fw-medium">Blogu is a personal blog that contains about programming, technology, web and so on.</p>
</div>
</div>
<div class="posts">
<div class="container text-center">
<h1 class="title title-md mb-4">Latest Posts</h1>
<div class="posts-grid">
<?php foreach ($posts as $post) : ?>
<div class="card">
<div class="card-image">
<img src="./images/posts/<?= $post['thumbnail']; ?>" alt="<?= $post['title']; ?>">
</div>
<div class="card-content">
<small class="card-info"><?= date('F d Y', $post['publishedAt']); ?></small>
<h2 class="card-title"><a href="post.php?id=<?= $post['id']; ?>"><?= $post['title']; ?></a></h2>
<p class="card-text">
<?= $post['description']; ?>
</p>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p>Created and managed by <a href="/" class="footer-highlight">Muhammad Pauzi.</a></p>
</div>
</footer>
<script src="./js/main.js"></script>
</body>
</html>