Skip to content

Commit

Permalink
fix: 摘要同步
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Aug 26, 2023
1 parent 74f9875 commit f761572
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/publish/BatchPublishIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ const syncDynList = (selectedKeys: string[]) => {
const syncDesc = (val: string) => {
formData.siyuanPost.shortDesc = val
formData.siyuanPost.mt_text_more = val
formData.siyuanPost.mt_excerpt = val
logger.debug("syncDesc in batch publish")
}
Expand Down
2 changes: 2 additions & 0 deletions src/components/publish/SinglePublishDoPublish.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ const syncPublishTitle = (val: string) => {
const syncDesc = (val: string) => {
formData.mergedPost.shortDesc = val
formData.mergedPost.mt_text_more = val
formData.mergedPost.mt_excerpt = val
logger.debug("syncDesc in single publish")
}
Expand Down
3 changes: 3 additions & 0 deletions src/composables/usePublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ const usePublish = () => {
post = await api.preEditPost(post, id, publishCfg)
logger.debug(`after preEditPost, post=>`, toRaw(post))

// 同步摘要
post.mt_excerpt = post.shortDesc
post.mt_text_more = post.shortDesc
// 发布格式
if (cfg?.pageType == PageTypeEnum.Markdown) {
post.description = post.markdown
Expand Down

0 comments on commit f761572

Please sign in to comment.