All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 1m53s
Build & Deploy / 🏗️ Build (push) Successful in 7m44s
Build & Deploy / 🚀 Deploy (push) Successful in 33s
Build & Deploy / 🧪 Smoke Test (push) Successful in 59s
Build & Deploy / ⚡ Lighthouse (push) Successful in 3m14s
Build & Deploy / 🔔 Notify (push) Successful in 1s
- Integrated imgproxy for centralized image optimization - Implemented Lighthouse CI in Gitea pipeline with native Chromium - Reached 100/100 SEO score by fixing canonicals, hreflang, and link text - Optimized LCP by forcing Hero component visibility until hydration - Decoupled analytics into an async shell to reduce TTI
28 lines
756 B
TypeScript
28 lines
756 B
TypeScript
import { getImgproxyUrl } from './imgproxy';
|
|
|
|
/**
|
|
* Next.js Image Loader for imgproxy
|
|
*
|
|
* @param {Object} props - properties from Next.js Image component
|
|
* @param {string} props.src - The source image URL
|
|
* @param {number} props.width - The desired image width
|
|
* @param {number} props.quality - The desired image quality (ignored for now as imgproxy handles it)
|
|
*/
|
|
export default function imgproxyLoader({
|
|
src,
|
|
width,
|
|
_quality,
|
|
}: {
|
|
src: string;
|
|
width: number;
|
|
_quality?: number;
|
|
}) {
|
|
// We use the width provided by Next.js for responsive images
|
|
// Height is set to 0 to maintain aspect ratio
|
|
return getImgproxyUrl(src, {
|
|
width,
|
|
resizing_type: 'fit',
|
|
gravity: 'fv', // Use face-aware focusing (face detection)
|
|
});
|
|
}
|