[O] Show preview

This commit is contained in:
Hykilpikonna
2021-12-26 11:17:58 -05:00
parent 145168d1c6
commit 10c5737b87
+7 -1
View File
@@ -6,7 +6,8 @@
<div id="subtitle" v-if="meta.subtitle">{{meta.subtitle}}</div>
</div>
<img :src="image" v-if="image" alt="Title Image">
<div id="expand">展开...</div>
<div id="preview" class="markdown-content" v-html="preview"></div>
<div id="expand" v-if="meta.more_content">展开...</div>
</div>
</template>
@@ -23,6 +24,9 @@ export interface BlogPostMeta
file: string
date: string
preview: string
more_content: string
subtitle?: string
title_image?: string
}
@@ -43,6 +47,8 @@ export default class BlogPostPreview extends Vue
}
}
get preview(): string { return marked(this.meta.preview) }
get image(): string | null
{ return this.meta.title_image ? hosts.content + '/' + this.meta.title_image : null }
}