diff --git a/themes/proxio/components/Blog.js b/themes/proxio/components/Blog.js
index 9773413b..a4d71972 100644
--- a/themes/proxio/components/Blog.js
+++ b/themes/proxio/components/Blog.js
@@ -9,6 +9,17 @@ import Link from 'next/link'
* @returns
*/
export const Blog = ({ posts }) => {
+ const enable = siteConfig('PROXIO_BLOG_ENABLE')
+ if (!enable) {
+ return null
+ }
+
+ // 博客列表默认显示summary文字,当鼠标指向时显示文章封面。这里可选把summary文字替换成图片占位符。
+ const PROXIO_BLOG_PLACEHOLDER_IMG_URL_1 = siteConfig('PROXIO_BLOG_PLACEHOLDER_IMG_URL_1')
+ const PROXIO_BLOG_PLACEHOLDER_IMG_URL_2 = siteConfig('PROXIO_BLOG_PLACEHOLDER_IMG_URL_2')
+ const PROXIO_BLOG_PLACEHOLDER_IMG_URL_3 = siteConfig('PROXIO_BLOG_PLACEHOLDER_IMG_URL_3')
+ const PROXIO_BLOG_PLACEHOLDER_IMG_URL_4 = siteConfig('PROXIO_BLOG_PLACEHOLDER_IMG_URL_4')
+
return (
<>
{/* */}
@@ -31,6 +42,17 @@ export const Blog = ({ posts }) => {
{/* 博客列表 此处优先展示3片文章 */}
{posts?.map((item, index) => {
+ // 文章封面图片,默认使用占位符 根据index 判断获取的时哪一张图片
+ let coverImg = PROXIO_BLOG_PLACEHOLDER_IMG_URL_1
+ if (index === 0) {
+ coverImg = PROXIO_BLOG_PLACEHOLDER_IMG_URL_1
+ } else if (index === 1) {
+ coverImg = PROXIO_BLOG_PLACEHOLDER_IMG_URL_2
+ } else if (index === 2) {
+ coverImg = PROXIO_BLOG_PLACEHOLDER_IMG_URL_3
+ } else if (index === 3) {
+ coverImg = PROXIO_BLOG_PLACEHOLDER_IMG_URL_4
+ }
return (
{
{/* 鼠标悬停时显示的文字内容 */}
-
+ {!coverImg &&
{item.summary}
-
+ }
+
+
{/* 内容部分 */}
diff --git a/themes/proxio/components/Features.js b/themes/proxio/components/Features.js
index 72985adb..6f932fd6 100644
--- a/themes/proxio/components/Features.js
+++ b/themes/proxio/components/Features.js
@@ -4,6 +4,7 @@ import { SVGEssential } from './svg/SVGEssential'
import { SVGGifts } from './svg/SVGGifts'
import { SVGTemplate } from './svg/SVGTemplate'
import Link from 'next/link'
+import LazyImage from '@/components/LazyImage'
/**
* 产品特性相关,将显示在首页中
* @returns
@@ -36,8 +37,9 @@ export const Features = () => {
-
@@ -52,8 +54,9 @@ export const Features = () => {
-
@@ -68,8 +71,9 @@ export const Features = () => {
-
diff --git a/themes/proxio/components/LoadingCover.js b/themes/proxio/components/LoadingCover.js
index a8d134e8..11e49035 100644
--- a/themes/proxio/components/LoadingCover.js
+++ b/themes/proxio/components/LoadingCover.js
@@ -26,7 +26,7 @@ const LoadingCover = ({ onFinishLoading }) => {
document.body.appendChild(ripple);
// 添加页面缩放 + 模糊动画
- pageContainer.classList.add('page-clicked');
+ pageContainer?.classList?.add('page-clicked');
// 模拟加载完成,调用回调函数
setTimeout(() => {
@@ -55,7 +55,7 @@ const LoadingCover = ({ onFinishLoading }) => {
return (