Add (lqip)

This commit is contained in:
2023-07-30 16:59:30 +08:00
parent 3acbf03d4e
commit 3812976c0f
22 changed files with 166 additions and 85 deletions

View File

@@ -87,4 +87,15 @@ public function getHtmlBodyAttribute()
return '';
}
public function getFeaturedImageLqipAttribute()
{
$featuredImage = $this->featured_image;
// Get the extension of the original featured image
$extension = pathinfo($featuredImage, PATHINFO_EXTENSION);
// Append "_lqip" before the extension to create the LQIP image URL
return str_replace(".{$extension}", "_lqip.{$extension}", $featuredImage);
}
}