加快友情链接图片加载速度

This commit is contained in:
tangly1024.com
2024-01-31 16:48:45 +08:00
parent 3a9da4ed6a
commit eced20bfe7
2 changed files with 6 additions and 6 deletions

View File

@@ -244,7 +244,7 @@ const BLOG = {
// ********挂件组件相关********
// ----> 评论互动 可同时开启多个支持 WALINE VALINE GISCUS CUSDIS UTTERRANCES GITALK
COMMENT_HIDE_SINGLE_TAB: process.env.NEXT_PUBLIC_COMMENT_HIDE_SINGLE_TAB || false, //Whether hide the tab when there's no tabs. 只有一个评论组件时是否隐藏切换组件的标签页
COMMENT_HIDE_SINGLE_TAB: process.env.NEXT_PUBLIC_COMMENT_HIDE_SINGLE_TAB || false, // Whether hide the tab when there's no tabs. 只有一个评论组件时是否隐藏切换组件的标签页
// artalk 评论插件
COMMENT_ARTALK_SERVER: process.env.NEXT_PUBLIC_COMMENT_ARTALK_SERVER || '', // ArtalkServert后端地址 https://artalk.js.org/guide/deploy.html
@@ -353,7 +353,7 @@ const BLOG = {
process.env.NEXT_PUBLIC_SEO_BAIDU_SITE_VERIFICATION || '', // Remove the value or replace it with your own google site verification code
// 微软 Clarity 站点分析
CLARITY_ID: process.env.NEXT_PUBLIC_CLARITY_ID || null , // 只需要复制Clarity脚本中的ID部分ID是一个十位的英文数字组合
CLARITY_ID: process.env.NEXT_PUBLIC_CLARITY_ID || null, // 只需要复制Clarity脚本中的ID部分ID是一个十位的英文数字组合
// <---- 站点统计

View File

@@ -8,7 +8,7 @@ import BLOG from '@/blog.config'
* @param {*} value
* @returns
*/
const mapImgUrl = (img, block, type = 'block', from) => {
const mapImgUrl = (img, block, type = 'block', from = 'post') => {
if (!img) {
return null
}
@@ -56,10 +56,10 @@ const mapImgUrl = (img, block, type = 'block', from) => {
}
}
// 文章封面压缩
if (from === 'pageCoverThumbnail' || block.type === 'image') {
console.log('block', block)
// 统一压缩图片
const width = block?.format?.block_width
if (from === 'pageCoverThumbnail' || block.type === 'image' || block.type === 'page') {
const width = block?.format?.block_width || 200
ret = compressImage(ret, width)
}