mirror of https://github.com/halo-dev/halo-admin
feat: support set gravatar source. (#314)
parent
83e5ac911f
commit
f2cf544a35
|
@ -15,12 +15,7 @@
|
|||
<a-list :loading="postCommentsLoading" :dataSource="converttedPostComments">
|
||||
<a-list-item slot="renderItem" slot-scope="item">
|
||||
<a-list-item-meta>
|
||||
<a-avatar
|
||||
class="bg-white"
|
||||
slot="avatar"
|
||||
:src="'//cn.gravatar.com/avatar/' + item.gravatarMd5 + '&d=mm'"
|
||||
size="large"
|
||||
/>
|
||||
<a-avatar class="bg-white" slot="avatar" :src="item.avatar" size="large" />
|
||||
<template slot="title">
|
||||
<a :href="item.authorUrl" target="_blank">{{ item.author }}</a
|
||||
>:<span v-html="item.content"></span>
|
||||
|
@ -36,12 +31,7 @@
|
|||
<a-list :loading="sheetCommentsLoading" :dataSource="converttedSheetComments">
|
||||
<a-list-item slot="renderItem" slot-scope="item">
|
||||
<a-list-item-meta>
|
||||
<a-avatar
|
||||
class="bg-white"
|
||||
slot="avatar"
|
||||
:src="'//cn.gravatar.com/avatar/' + item.gravatarMd5 + '&d=mm'"
|
||||
size="large"
|
||||
/>
|
||||
<a-avatar class="bg-white" slot="avatar" :src="item.avatar" size="large" />
|
||||
<template slot="title">
|
||||
<a :href="item.authorUrl" target="_blank">{{ item.author }}</a
|
||||
>:<span v-html="item.content"></span>
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
<a v-if="type === 'posts'" :href="item.post.fullPath" target="_blank">《{{ item.post.title }}》</a>
|
||||
<a v-if="type === 'sheets'" :href="item.sheet.fullPath" target="_blank">《{{ item.sheet.title }}》</a>
|
||||
</template>
|
||||
<a-avatar slot="avatar" size="large" :src="'//cn.gravatar.com/avatar/' + item.gravatarMd5 + '&d=mm'" />
|
||||
<a-avatar slot="avatar" size="large" :src="item.avatar" />
|
||||
<span
|
||||
slot="title"
|
||||
style="max-width: 300px;display: block;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<a-icon type="user" v-if="comment.isAdmin" style="margin-right: 3px;" />
|
||||
{{ comment.author }}
|
||||
</a>
|
||||
<a-avatar size="large" slot="avatar" :src="avatar" :alt="comment.author" />
|
||||
<a-avatar size="large" slot="avatar" :src="comment.avatar" :alt="comment.author" />
|
||||
<p slot="content" v-html="content"></p>
|
||||
<a-tooltip slot="datetime">
|
||||
<span slot="title">{{ comment.createTime | moment }}</span>
|
||||
|
@ -78,9 +78,6 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
avatar() {
|
||||
return `//cn.gravatar.com/avatar/${this.comment.gravatarMd5}/?s=256&d=mp`
|
||||
},
|
||||
content() {
|
||||
return marked(this.comment.content)
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<a-list itemLayout="horizontal" :dataSource="formmatedCommentData" :loading="loading">
|
||||
<a-list-item slot="renderItem" slot-scope="item, index" :key="index">
|
||||
<a-comment :avatar="'//cn.gravatar.com/avatar/' + item.gravatarMd5 + '/?s=256&d=mp'">
|
||||
<a-comment :avatar="item.avatar">
|
||||
<template slot="author" v-if="type === 'posts'">
|
||||
<a :href="item.authorUrl" target="_blank">{{ item.author }}</a> 发表在 《<a
|
||||
v-if="item.post.status == 'PUBLISHED' || item.post.status == 'INTIMATE'"
|
||||
|
|
|
@ -24,13 +24,11 @@
|
|||
<a-form-model-item label="API 评论开关:" help="* 关闭之后将无法进行评论">
|
||||
<a-switch v-model="options.comment_api_enabled" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="评论模块 JS:">
|
||||
<a-input
|
||||
type="textarea"
|
||||
:autoSize="{ minRows: 2 }"
|
||||
v-model="options.comment_internal_plugin_js"
|
||||
placeholder="该设置仅对内置的评论模块有效"
|
||||
/>
|
||||
<a-form-model-item label="评论模块 JS:" help="* 该设置需要主题支持">
|
||||
<a-input type="textarea" :autoSize="{ minRows: 2 }" v-model="options.comment_internal_plugin_js" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="Gravatar 镜像源:" help="* 例如://gravatar.com/avatar/">
|
||||
<a-input v-model="options.gravatar_source" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="每页显示条数: ">
|
||||
<a-input-number v-model="options.comment_page_size" :min="1" style="width:100%" />
|
||||
|
|
Loading…
Reference in New Issue