diff options
Diffstat (limited to 'src/html/blog.html')
-rw-r--r-- | src/html/blog.html | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/html/blog.html b/src/html/blog.html index c034711..c0662f7 100644 --- a/src/html/blog.html +++ b/src/html/blog.html @@ -6,11 +6,12 @@ <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/styles.css"> - <script src="https://cdn.jsdelivr.net/npm/vue"></script> - <!-- <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> --> - <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> + <script src="/js/feed.js"></script> + <!-- <script src="https://cdn.jsdelivr.net/npm/vue"></script> --> + <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> + <!-- <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> --> <script> - window.onload = function () { + window.onload = loadFeed(function () { var feed = new Vue({ el: '.feed', data: { @@ -18,15 +19,12 @@ }, created() { fetch(new Request('/posts/blog')).then(response => response.json()) - .then(response => { response.forEach(post => { - post.description = marked(post.description) - this.posts.push(post); - }); - }); - } - }); + .then(response => this.posts = response); } + }); + }) </script> + </head> <body> @@ -35,7 +33,7 @@ <a class="navigation" href="/" title="marks.kitchen"><</a> Blog </h1> - <div id="feed" class="feed"> + <!-- <div id="feed" class="feed"> <div class="card" v-for="post in posts"> <p class="card-text" v-html="post.description"></p> <div class="card-img"> @@ -44,13 +42,14 @@ </span> </div> <p class="date"> - <a v-bind:href="'/blog/'+post.id">{{ post.createdAt.substring(0,10) }}</a> + <a v-bind:href="'/blog/'+post.id">{{{ post.createdAt.substring(0,10) }}}</a> <span v-for="tag in post.tags"> <a class="tag" v-bind:href="'/tags#'+tag">{{tag}}</a> </span> </p> </div> - </div> + </div> --> + <div id="feed" class="feed"></div> </div> </body> |