Skip to content

Commit 6bc95ef

Browse files
authored
feat: 笔记图片采用缩略图
1 parent 8a24351 commit 6bc95ef

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

inc/core-rest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ function ajax_get_all_posts_callback() {
120120
return [
121121
'id' => $id,
122122
'mime_type' => $attachment->post_mime_type,
123-
'source_url' => replace_domain( $attachment->guid )
123+
'source_url' => replace_domain( $attachment->guid ),
124+
'thumbnail' => replace_domain( wp_get_attachment_image_url($id, "medium_large") ),
124125
];
125126
}, $ids ), function ($item){
126127
return $item;

static/modules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ const $modules = new function () {
883883
</div>
884884
<div v-if="note.images" class="notes-item-images flex-center justify-start">
885885
<div class="notes-item-images__item c-zoom-in" v-for="item in note.images" :key="item.id">
886-
<img class="s-rounded" :src="item.source_url" alt @click="handleViewImage(item.source_url)"/>
886+
<img class="s-rounded" :src="item.thumbnail" alt @click="handleViewImage(item.source_url)"/>
887887
</div>
888888
</div>
889889
<attachment-chips v-if="note.attachment" :attachments="note.attachment"></attachment-chips>

style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Description: Simple, smooth, data-driven, responsive WordPress theme
66
Author: Tokin
77
Author URI: https://biji.io
8-
Version: 0.7.35
8+
Version: 0.7.36
99
Tested up to: 5.9.3
1010
Requires at least: 5.8
1111
Requires PHP: 7.0

0 commit comments

Comments
 (0)