🚀 如何优雅的使用微云来做图床

🚀 如何优雅的使用微云来做图床

👀 效果图

🎨 UI 设计特点

  1. 简洁现代风格圆角卡片设计
  2. 响应式布局(适配手机/PC)
  3. 视觉层次卡片式分区

⚙️ 功能特点

  • 多格式复制(原始链接/Markdown/HTML)

  • 微云分享链接解析

  • 自适应图片显示(保持比例)

部署教程

  1. 前往你的 Hexo 博客的根目录
  2. 在 Hexo 博客根目录 [blog]下打开终端,输入
1
hexo new page "weiyun"
  1. 你会找到 source/weiyun/index.md 这个文件
  2. 修改这个文件: 记得添加 type: "weiyun"
1
2
3
4
5
6
7
---
title:
date: 2025-09-25 11:46:43
top_img: false
comments: false
type: "weiyun"
---

然后把下面的代码丢进去

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312

<style>
.post-title, h1.entry-title {
text-align: center;
}

.container {
max-width:800px;
margin:0 auto;
padding:20px;
font-family:'Noto Sans SC',sans-serif;
}
.card {
background: var(--card-bg, #fff);
color: var(--text-color, #212529);
border-radius:10px;
padding:20px;
box-shadow:0 4px 6px rgba(0,0,0,.1);
margin-bottom:20px;
}
.input-group {
display:flex;
margin-bottom:20px;
}
.input-group input {
flex:1;
padding:10px;
border-radius:4px 0 0 4px;
outline:none;
background: var(--input-bg, #fff);
color: var(--text-color, #212529);
border:1px solid var(--border-color, #ddd);
}
.input-group button {
padding:0 15px;
background: var(--primary-color, #4361ee);
color: var(--button-text-color, #fff);
border:none;
border-radius:0 4px 4px 0;
cursor:pointer;
}


.result-box {
background: var(--card-bg, #fff);
border-radius:10px;
padding:20px;
box-shadow:0 4px 6px rgba(0,0,0,.1);
margin-top:20px;
word-break: break-all;
}


.url-container {
display:flex;
margin:15px 0 10px 0;
flex-wrap: wrap;
gap: 5px;
}
.url-input {
flex:1;
padding:8px;
border:1px solid var(--border-color, #ddd);
border-right:none;
outline:none;
background: var(--input-bg, #f8f9fa);
color: var(--text-color, #212529);
min-width: 200px;
}
.copy-btn {
padding:0 10px;
background: var(--primary-color, #4cc9f0);
color: var(--button-text-color, #fff);
border:none;
cursor:pointer;
display:flex;
align-items:center;
margin-left:5px;
white-space: nowrap;
}
.copy-btn.md { background: var(--secondary-color, #6c757d); }
.copy-btn.html { background: var(--dark-color, #495057); }


.image-preview {
display: none;
justify-content: center;
align-items: center;
margin-top: 20px;
}
.image-preview img {
max-width: 100%;
height: auto;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,.1);
pointer-events: none;
user-select: none;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
user-drag: none;
}

@media (max-width: 768px) {
.container {
padding:10px;
}
.url-container {
flex-direction: column;
}
.url-input {
border-right:1px solid var(--border-color, #ddd);
border-radius:4px;
margin-bottom:5px;
}
.copy-btn {
margin-left:0;
border-radius:4px;
justify-content: center;
}
.image-preview img {
width: 90%;
}
}

@keyframes spin {
0% { transform: rotate(0deg);}
100% { transform: rotate(360deg);}
}

#toastContainer {
position: fixed;
top: 100px;
left: 50%;
transform: translateX(-50%);
z-index: 9999;
}
.toast {
display: inline-block;
padding: 10px 20px;
border-radius: 50px;
margin-top: 10px;
font-size: 14px;
opacity: 0;
backdrop-filter: blur(10px);
background: rgba(255, 255, 255, 0.2);
animation: fadein 0.3s forwards, fadeout 0.3s forwards 4s;
}

.toast.success { color: #28a745; }
.toast.error { color: #dc3545; }
@keyframes fadein {
from {opacity: 0; transform: translateY(-10px);}
to {opacity: 1; transform: translateY(0);}
}
@keyframes fadeout {
from {opacity: 1;}
to {opacity: 0;}
}
</style>

<h1 style="text-align:center;">微云直链提取</h1>


<div id="toastContainer"></div>

<div class="container">
<div class="card">
<div class="input-group">
<input type="text" id="weiyunUrl" placeholder="输入微云分享链接(例如:https://share.weiyun.com/xxxxxxxx)">
<button onclick="extractImage()">提取图片</button>
</div>
</div>

<div id="result"></div>

<div class="image-preview" id="imagePreview">
<img id="previewImg" src="" alt="">
</div>
</div>

<script>
const REFRESH_TIMES = 2;
const INTERVAL = 10;
let currentImageUrl = '';

async function extractImage() {
const url = document.getElementById('weiyunUrl').value.trim();
if(!url){
showToast('❗️ 请输入微云分享链接', 'error');
return;
}
if(!url.includes('share.weiyun.com')) {
showToast('❗️ 请输入正确的微云分享链接', 'error');
return;
}

try {
showLoading();
const res = await fetch('https://api.allorigins.win/get?url=' + encodeURIComponent(url));
const data = await res.json();
const html = data.contents;

const match = html.match(/window\.syncData\s*=\s*({.+?});/s);
if(!match){ throw '❗️ 未找到图片信息,请检查链接是否正确'; }

const syncData = JSON.parse(match[1]);
const file = syncData.shareInfo.file_list[0];
if(!file){ throw '❗️ 未找到文件信息,该链接可能已失效'; }

let previewUrl = file.https_thumb_url || file.thumb_url;
if(previewUrl.indexOf('size=')===-1){
previewUrl += (previewUrl.indexOf('?')===-1?'?':'&') + 'size=1000';
}
currentImageUrl = previewUrl;

document.getElementById('result').innerHTML = `
<div class="result-box">
<p><strong>📝 文件名:</strong> ${file.file_name}</p>
<p><strong>⚖️ 大小:</strong> ${(file.file_size/1024/1024).toFixed(2)} MB</p>
<p><strong>🔤 格式:</strong> ${file.file_name.split('.').pop().toUpperCase()}</p>

<div class="url-container">
<input class="url-input" value="${previewUrl}" readonly id="imageUrl">
<button class="copy-btn" onclick="copyToClipboard()">复制链接</button>
<button class="copy-btn md" onclick="copyMarkdown()">Markdown</button>
<button class="copy-btn html" onclick="copyHtml()">HTML</button>
</div>
</div>
`;

const previewImg = document.getElementById('previewImg');
const imagePreview = document.getElementById('imagePreview');
imagePreview.style.display = 'flex';
previewImg.alt = file.file_name;

previewImg.addEventListener('click', e => e.stopPropagation());
imagePreview.addEventListener('click', e => e.stopPropagation());

for (let i = 0; i < REFRESH_TIMES; i++) {
setTimeout(() => {
previewImg.src = previewUrl + "&_t" + i + "=" + Date.now();
}, i * INTERVAL);
}

} catch(e){
document.getElementById('result').innerHTML = `
<div class="result-box" style="color:red;">
<strong>‼️ 错误:</strong> ${e}
<p style="margin-top:10px;font-size:14px;">❗️ 请检查:</p>
<ul style="margin:5px 0;padding-left:20px;">
<li>❓ 链接是否正确</li>
<li>❓ 链接是否已过期</li>
<li>❓ 网络连接是否正常</li>
</ul>
</div>`;
document.getElementById('imagePreview').style.display = 'none';
showToast('🚫 提取图片失败', 'error');
}
}

function copyToClipboard(){
const input = document.getElementById('imageUrl');
input.select();
document.execCommand('copy');
showToast('✅ 已复制图片地址到剪贴板', 'success');
}

function copyMarkdown(){
const input = document.getElementById('imageUrl');
const text = `![](${input.value})`;
navigator.clipboard.writeText(text);
showToast('✅ 已复制 Markdown 格式到剪贴板', 'success');
}

function copyHtml(){
const input = document.getElementById('imageUrl');
const text = `<img src="${input.value}" alt="图片">`;
navigator.clipboard.writeText(text);
showToast('✅ 已复制 HTML 格式到剪贴板', 'success');
}

function showLoading() {
document.getElementById('result').innerHTML = `
<div class="result-box" style="text-align:center;">
<div style="display:inline-block;width:20px;height:20px;border:2px solid #f3f3f3;border-top:2px solid #4361ee;border-radius:50%;animation:spin 1s linear infinite;"></div>
<p style="margin-top:10px;">正在提取图片链接...</p>
</div>
`;
}


function showToast(message, type='success') {
const container = document.getElementById('toastContainer');
const toast = document.createElement('div');
toast.className = 'toast ' + (type==='success'?'success':'error');
toast.textContent = message;
container.appendChild(toast);

setTimeout(() => {
toast.remove();
}, 4000);
}


document.getElementById('weiyunUrl').addEventListener('keypress', function(e) {
if(e.key === 'Enter') {
extractImage();
}
});
</script>

上面代码中的代理挂了,自己拿服务器弄了个接口

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
---
title:
date: 2025-09-25 11:46:43
top_img: false
comments: false
type: "weiyun"
---

<style>
.post-title, h1.entry-title {
text-align: center;
}

.container {
max-width:800px;
margin:0 auto;
padding:20px;
font-family:'Noto Sans SC',sans-serif;
}
.card {
background: var(--card-bg, #fff);
color: var(--text-color, #212529);
border-radius:10px;
padding:20px;
box-shadow:0 4px 6px rgba(0,0,0,.1);
margin-bottom:20px;
}
.input-group {
display:flex;
margin-bottom:20px;
}
.input-group input {
flex:1;
padding:10px;
border-radius:4px 0 0 4px;
outline:none;
background: var(--input-bg, #fff);
color: var(--text-color, #212529);
border:1px solid var(--border-color, #ddd);
}
.input-group button {
padding:0 15px;
background: var(--primary-color, #4361ee);
color: var(--button-text-color, #fff);
border:none;
border-radius:0 4px 4px 0;
cursor:pointer;
}


.result-box {
background: var(--card-bg, #fff);
border-radius:10px;
padding:20px;
box-shadow:0 4px 6px rgba(0,0,0,.1);
margin-top:20px;
word-break: break-all;
}


.url-container {
display:flex;
margin:15px 0 10px 0;
flex-wrap: wrap;
gap: 5px;
}
.url-input {
flex:1;
padding:8px;
border:1px solid var(--border-color, #ddd);
border-right:none;
outline:none;
background: var(--input-bg, #f8f9fa);
color: var(--text-color, #212529);
min-width: 200px;
}
.copy-btn {
padding:0 10px;
background: var(--primary-color, #4cc9f0);
color: var(--button-text-color, #fff);
border:none;
cursor:pointer;
display:flex;
align-items:center;
margin-left:5px;
white-space: nowrap;
}
.copy-btn.md { background: var(--secondary-color, #6c757d); }
.copy-btn.html { background: var(--dark-color, #495057); }


.image-preview {
display: none;
justify-content: center;
align-items: center;
margin-top: 20px;
}
.image-preview img {
max-width: 100%;
height: auto;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,.1);
pointer-events: none;
user-select: none;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
-o-user-drag: none;
user-drag: none;
}

@media (max-width: 768px) {
.container {
padding:10px;
}
.url-container {
flex-direction: column;
}
.url-input {
border-right:1px solid var(--border-color, #ddd);
border-radius:4px;
margin-bottom:5px;
}
.copy-btn {
margin-left:0;
border-radius:4px;
justify-content: center;
}
.image-preview img {
width: 90%;
}
}

@keyframes spin {
0% { transform: rotate(0deg);}
100% { transform: rotate(360deg);}
}

#toastContainer {
position: fixed;
top: 100px;
left: 50%;
transform: translateX(-50%);
z-index: 9999;
}
.toast {
display: inline-block;
padding: 10px 20px;
border-radius: 50px;
margin-top: 10px;
font-size: 14px;
opacity: 0;
backdrop-filter: blur(10px);
background: rgba(255, 255, 255, 0.2);
animation: fadein 0.3s forwards, fadeout 0.3s forwards 4s;
}

.toast.success { color: #28a745; }
.toast.error { color: #dc3545; }
@keyframes fadein {
from {opacity: 0; transform: translateY(-10px);}
to {opacity: 1; transform: translateY(0);}
}
@keyframes fadeout {
from {opacity: 1;}
to {opacity: 0;}
}
</style>

<h1 style="text-align:center;">微云直链提取</h1>


<div id="toastContainer"></div>

<div class="container">
<div class="card">
<div class="input-group">
<input type="text" id="weiyunUrl" placeholder="输入微云分享链接(例如:https://share.weiyun.com/xxxxxxxx)">
<button onclick="extractImage()">提取图片</button>
</div>
</div>

<div id="result"></div>

<div class="image-preview" id="imagePreview">
<img id="previewImg" src="" alt="">
</div>
</div>

<script>
const REFRESH_TIMES = 2;
const INTERVAL = 10;
let currentImageUrl = '';

// PHP API 地址(使用GET请求)
const PHP_API_URL = 'https://zan.lxb.icu/get_api.php';

async function extractImage() {
const url = document.getElementById('weiyunUrl').value.trim();
if(!url){
showToast('❗️ 请输入微云分享链接', 'error');
return;
}
if(!url.includes('share.weiyun.com')) {
showToast('❗️ 请输入正确的微云分享链接', 'error');
return;
}

try {
showLoading();

// 使用GET请求调用PHP API
const apiUrl = `${PHP_API_URL}?url=${encodeURIComponent(url)}`;
const response = await fetch(apiUrl);

const result = await response.json();

if (!result.success) {
throw new Error(result.error || '提取失败');
}

const data = result.data;
currentImageUrl = data.image_url;

// 显示结果
document.getElementById('result').innerHTML = `
<div class="result-box">
<p><strong>📝 文件名:</strong> ${data.filename}</p>
<p><strong>⚖️ 大小:</strong> ${data.size}</p>
<p><strong>🔤 格式:</strong> ${data.format}</p>
<p><strong>📏 尺寸:</strong> ${data.dimensions}</p>

<div class="url-container">
<input class="url-input" value="${data.image_url}" readonly id="imageUrl">
<button class="copy-btn" onclick="copyToClipboard()">复制链接</button>
<button class="copy-btn md" onclick="copyMarkdown()">Markdown</button>
<button class="copy-btn html" onclick="copyHtml()">HTML</button>
</div>
</div>
`;

const previewImg = document.getElementById('previewImg');
const imagePreview = document.getElementById('imagePreview');
imagePreview.style.display = 'flex';
previewImg.alt = data.filename;

// 加载预览图片
for (let i = 0; i < REFRESH_TIMES; i++) {
setTimeout(() => {
previewImg.src = data.image_url + "&_t" + i + "=" + Date.now();
}, i * INTERVAL);
}

} catch(e) {
document.getElementById('result').innerHTML = `
<div class="result-box" style="color:red;">
<strong>‼️ 错误:</strong> ${e.message || e}
<p style="margin-top:10px;font-size:14px;">❗️ 请检查:</p>
<ul style="margin:5px 0;padding-left:20px;">
<li>❓ 链接是否正确</li>
<li>❓ 链接是否已过期</li>
<li>❓ PHP环境是否支持cURL</li>
</ul>
</div>`;
document.getElementById('imagePreview').style.display = 'none';
showToast('🚫 提取图片失败', 'error');
}
}

// 其他辅助函数保持不变
function copyToClipboard(){
const input = document.getElementById('imageUrl');
input.select();
document.execCommand('copy');
showToast('✅ 已复制图片地址到剪贴板', 'success');
}

function copyMarkdown(){
const input = document.getElementById('imageUrl');
const text = ``;
navigator.clipboard.writeText(text);
showToast('✅ 已复制 Markdown 格式到剪贴板', 'success');
}

function copyHtml(){
const input = document.getElementById('imageUrl');
const text = ``;
navigator.clipboard.writeText(text);
showToast('✅ 已复制 HTML 格式到剪贴板', 'success');
}

function showLoading() {
document.getElementById('result').innerHTML = `
<div class="result-box" style="text-align:center;">
<div style="display:inline-block;width:20px;height:20px;border:2px solid #f3f3f3;border-top:2px solid #4361ee;border-radius:50%;animation:spin 1s linear infinite;"></div>
<p style="margin-top:10px;">正在提取图片链接...</p>
</div>
`;
}

function showToast(message, type='success') {
const container = document.getElementById('toastContainer');
const toast = document.createElement('div');
toast.className = 'toast ' + (type==='success'?'success':'error');
toast.textContent = message;
container.appendChild(toast);

setTimeout(() => {
toast.remove();
}, 4000);
}

// 支持回车键触发
document.getElementById('weiyunUrl').addEventListener('keypress', function(e) {
if(e.key === 'Enter') {
extractImage();
}
});

// 支持直接通过URL参数传递
window.addEventListener('load', function() {
const urlParams = new URLSearchParams(window.location.search);
const url = urlParams.get('url');
if (url) {
document.getElementById('weiyunUrl').value = url;
extractImage();
}
});
</script>

自己有服务器的话自己部署一下,很简单,新建get_api.php丢入下列代码即可

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, OPTIONS');

// 处理预检请求
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
http_response_code(200);
exit();
}

// 只允许GET请求
if ($_SERVER['REQUEST_METHOD'] !== 'GET') {
http_response_code(405);
echo json_encode(['error' => '只允许GET请求', 'success' => false]);
exit();
}

// 获取URL参数
$url = isset($_GET['url']) ? trim($_GET['url']) : '';

// 验证URL
if (empty($url)) {
http_response_code(400);
echo json_encode(['error' => '请输入微云分享链接', 'success' => false]);
exit();
}

if (strpos($url, 'share.weiyun.com') === false) {
http_response_code(400);
echo json_encode(['error' => '请输入正确的微云分享链接', 'success' => false]);
exit();
}

// 提取微云图片信息
function fetchWeiyunImage($url) {
$ch = curl_init();

curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
CURLOPT_REFERER => 'https://share.weiyun.com/',
CURLOPT_TIMEOUT => 15,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_ENCODING => 'gzip, deflate'
]);

$html = curl_exec($ch);
$error = curl_error($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($error) {
throw new Exception('网络请求失败: ' . $error);
}

if ($httpCode !== 200) {
throw new Exception('微云链接访问失败,HTTP代码: ' . $httpCode);
}

// 解析HTML内容
if (preg_match('/window\.syncData\s*=\s*({.+?})\s*;/is', $html, $matches)) {
$data = json_decode($matches[1], true);

if (isset($data['shareInfo']['file_list'][0])) {
$file = $data['shareInfo']['file_list'][0];

$previewUrl = $file['https_thumb_url'] ?? $file['thumb_url'] ?? '';
if (empty($previewUrl)) {
throw new Exception('未找到图片链接');
}

// 添加size参数
if (strpos($previewUrl, 'size=') === false) {
$previewUrl .= (strpos($previewUrl, '?') === false ? '?' : '&') . 'size=1000';
}

return [
'success' => true,
'data' => [
'image_url' => $previewUrl,
'filename' => $file['file_name'] ?? '',
'size' => round(($file['file_size'] ?? 0) / 1024 / 1024, 2) . ' MB',
'format' => strtoupper(pathinfo($file['file_name'] ?? '', PATHINFO_EXTENSION)),
'dimensions' => ($file['width'] ?? 0) . '×' . ($file['height'] ?? 0)
]
];
}
}

throw new Exception('未找到图片信息,可能是链接已过期');
}

// 执行提取
try {
$result = fetchWeiyunImage($url);
echo json_encode($result);
} catch (Exception $e) {
http_response_code(500);
echo json_encode([
'error' => $e->getMessage(),
'success' => false
]);
}
?>

重要提示:获取到的微云图片链接主题无法取色,控制台会报错,尽量不要用于文章封面,如果用于文章封面请关闭主题取色。如果不介意文章信息栏以及控制台报错可忽略下面内容

修改 主题配置文件

如果用于文章封面 enable, 可以设置为 false。

主色调相关配置 mainTone 的 enable > 配置文件的 enable > false

1
2
3
4
5
6
7
# 主色调相关配置
mainTone:
enable: false # true or false 文章是否启用获取图片主色调
mode: api # colorthief/cdn/api/both colorthief模式为前端获取图片主色调,cdn模式为图片url+imageAve参数获取主色调,api模式为请求API获取主色调,both模式会先请求cdn参数,无法获取的情况下将请求API获取,可以在文章内配置main_color: '#3e5658',使用十六进制颜色,则不会请求colorthief/cdn/api/both获取主色调,而是直接使用配置的颜色
# 项目地址:https://github.com/anzhiyu-c/img2color-go
api: https://img2color-go.vercel.app/api?img= # mode为api时可填写
cover_change: true # 整篇文章跟随cover修改主色调

在主题配置文件的menu:里添加菜单

1
2
工具:
微云直链: /weiyun/ || icon-LINKS

🎉🎉 恭喜你,已完成部署。一键三连去看效果吧

1
hexo clean && hexo g && hexo s

最后在贴一个微云分享链接的图片吧,以免不会用

小声逼逼一下:如果点击提取图片并没有加载出来或者报错,尝试3-4次就出来了