[O] Show preview
This commit is contained in:
@@ -6,7 +6,8 @@
|
|||||||
<div id="subtitle" v-if="meta.subtitle">{{meta.subtitle}}</div>
|
<div id="subtitle" v-if="meta.subtitle">{{meta.subtitle}}</div>
|
||||||
</div>
|
</div>
|
||||||
<img :src="image" v-if="image" alt="Title Image">
|
<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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -23,6 +24,9 @@ export interface BlogPostMeta
|
|||||||
file: string
|
file: string
|
||||||
date: string
|
date: string
|
||||||
|
|
||||||
|
preview: string
|
||||||
|
more_content: string
|
||||||
|
|
||||||
subtitle?: string
|
subtitle?: string
|
||||||
title_image?: 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
|
get image(): string | null
|
||||||
{ return this.meta.title_image ? hosts.content + '/' + this.meta.title_image : null }
|
{ return this.meta.title_image ? hosts.content + '/' + this.meta.title_image : null }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user