aboutsummaryrefslogtreecommitdiff
path: root/src/html/bread.html
blob: 37abee8ff118672bd8864e31fbbe96bae020f81e (plain)
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
<!doctype html>
<html lang="en">

<head>
    <title>Mark's Kitchen - Bread</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" type="text/css" href="/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/css/styles.css">
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script>
        window.onload = function () {
            fetch(new Request('/posts.json')).then(response => response.json())
                .then(response => {
                    var feed = new Vue({
                        el: '.feed',
                        data: { posts: response.data }
                    })
                });
        }

    </script>
</head>

<body>
    <div>
        <h1>Bread</h1>
        Some highlights (and lowlights) of breadmaking
        <div class="feed">
            <div class="card" v-for="post in posts">
                <p class="card-text">{{ post.description }}</p>
                <div class="card-img">
                    <span v-for="image in post.images">
                        <a v-bind:href="image"><img v-bind:src="image"></a>
                    </span>
                </div>
                <p class="date">{{ post.createdAt.substring(0,10) }}</p>
            </div>
        </div>
    </div>
</body>

</html>