Skip to content

Commit

Permalink
feat: 定制化ourea主题
Browse files Browse the repository at this point in the history
  • Loading branch information
shawti committed Nov 28, 2023
1 parent 8358544 commit 4e5afba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions components/LazyImage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { siteConfig } from '@/lib/config'
import Head from 'next/head'
import React, { useEffect, useRef, useState } from 'react'
import Image from 'next/image'
import Link from 'next/link'

/**
* 图片懒加载
Expand Down Expand Up @@ -89,10 +91,10 @@ export default function LazyImage({
}
return (<>
{/* eslint-disable-next-line @next/next/no-img-element */}
<img {...imgProps} />
<Image {...imgProps} />
{/* 预加载 */}
{priority && <Head>
<link rel='preload' as='image' src={src} />
<Link rel='preload' as='image' src={src} href={src} target='_blank'/>
</Head>}
</>)
}
3 changes: 2 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,6 @@ module.exports = withBundleAnalyzer({
publicRuntimeConfig: { // 这里的配置既可以服务端获取到,也可以在浏览器端获取到
NODE_ENV_API: process.env.NODE_ENV_API || 'prod',
THEMES: themes
}
},
basePath: process.env.BASE_PATH || ''
})

0 comments on commit 4e5afba

Please sign in to comment.