aboutsummaryrefslogtreecommitdiff
path: root/src/html
diff options
context:
space:
mode:
Diffstat (limited to 'src/html')
-rw-r--r--src/html/blog.html7
-rw-r--r--src/html/feed.html2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/html/blog.html b/src/html/blog.html
index a0a9361..4a35319 100644
--- a/src/html/blog.html
+++ b/src/html/blog.html
@@ -9,6 +9,7 @@
<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 = loadFeed(function () {
var feed = new Vue({
@@ -18,7 +19,11 @@
},
created() {
fetch(new Request('/posts/blog')).then(response => response.json())
- .then(response => this.posts = response);
+ .then(response => { response.forEach(post => {
+ post.description = marked(post.description)
+ this.posts.push(post);
+ });
+ });
}
});
})
diff --git a/src/html/feed.html b/src/html/feed.html
index 5b8cccd..15a364d 100644
--- a/src/html/feed.html
+++ b/src/html/feed.html
@@ -1,6 +1,6 @@
<div class="feed">
<div class="card" v-for="post in posts">
- <p class="card-text">{{ post.description }}</p>
+ <p class="card-text" v-html="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>