Change the last blogs component
This commit is contained in:
12
astro/package-lock.json
generated
12
astro/package-lock.json
generated
@@ -4066,9 +4066,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/baseline-browser-mapping": {
|
"node_modules/baseline-browser-mapping": {
|
||||||
"version": "2.10.14",
|
"version": "2.10.15",
|
||||||
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.14.tgz",
|
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.15.tgz",
|
||||||
"integrity": "sha512-fOVLPAsFTsQfuCkvahZkzq6nf8KvGWanlYoTh0SVA0A/PIUxQGU2AOZAoD95n2gFLVDW/jP6sbGLny95nmEuHA==",
|
"integrity": "sha512-1nfKCq9wuAZFTkA2ey/3OXXx7GzFjLdkTiFVNwlJ9WqdI706CZRIhEqjuwanjMIja+84jDLa9rcyZDPDiVkASQ==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
"baseline-browser-mapping": "dist/cli.cjs"
|
"baseline-browser-mapping": "dist/cli.cjs"
|
||||||
@@ -4151,9 +4151,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001784",
|
"version": "1.0.30001785",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001784.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001785.tgz",
|
||||||
"integrity": "sha512-WU346nBTklUV9YfUl60fqRbU5ZqyXlqvo1SgigE1OAXK5bFL8LL9q1K7aap3N739l4BvNqnkm3YrGHiY9sfUQw==",
|
"integrity": "sha512-blhOL/WNR+Km1RI/LCVAvA73xplXA7ZbjzI4YkMK9pa6T/P3F2GxjNpEkyw5repTw9IvkyrjyHpwjnhZ5FOvYQ==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import { getLastBlogs } from '@/content/blogs/blogs';
|
import { getLastBlogs } from '@/content/blogs/blogs';
|
||||||
import { getSettings } from '@/content/settings/settings';
|
import { getSettings } from '@/content/settings/settings';
|
||||||
import CalendarIcon from '@/icons/CalendarIcon.astro';
|
import CalendarIcon from '@/icons/CalendarIcon.astro';
|
||||||
import { getImageUrl } from '@/lib/images';
|
import { getImageSize, getImageUrl } from '@/lib/images';
|
||||||
import { getBlogRoute } from '@/lib/routing';
|
import { getBlogRoute } from '@/lib/routing';
|
||||||
import { Image } from 'astro:assets';
|
import { Image } from 'astro:assets';
|
||||||
|
|
||||||
@@ -43,14 +43,17 @@ const size = calculateSizeClasses(blogs.amount, lastBlogs.length);
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col lg:flex-row lg:justify-between gap-y-6">
|
<div class="flex flex-col lg:flex-row lg:justify-between gap-y-6">
|
||||||
{ lastBlogs.map((blog) => (
|
{ lastBlogs.map((blog) => {
|
||||||
|
const imageSize = getImageSize(blog.searchEngine.thumbnail.width, blog.searchEngine.thumbnail.height, 0.5);
|
||||||
|
|
||||||
|
return (
|
||||||
<a href={getBlogRoute(settings.blog, blog)} class={`${size} flex flex-col gap-2`}>
|
<a href={getBlogRoute(settings.blog, blog)} class={`${size} flex flex-col gap-2`}>
|
||||||
<Image
|
<Image
|
||||||
src={getImageUrl(blog.searchEngine.thumbnail.url)}
|
src={getImageUrl(blog.searchEngine.thumbnail.url)}
|
||||||
alt={blog.title}
|
alt={blog.title}
|
||||||
class="flex rounded-2xl shadow-md w-full"
|
class="flex rounded-2xl shadow-md w-full"
|
||||||
width={600}
|
width={imageSize.width}
|
||||||
height={315}
|
height={imageSize.height}
|
||||||
/>
|
/>
|
||||||
<h4 class="font-semibold text-[28px]">{blog.title}</h4>
|
<h4 class="font-semibold text-[28px]">{blog.title}</h4>
|
||||||
<div class="flex flex-row items-center gap-1.5 text-neutral-900 text-sm">
|
<div class="flex flex-row items-center gap-1.5 text-neutral-900 text-sm">
|
||||||
@@ -58,7 +61,8 @@ const size = calculateSizeClasses(blogs.amount, lastBlogs.length);
|
|||||||
<div>{blog.date}</div>
|
<div>{blog.date}</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
)) }
|
)
|
||||||
|
}) }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) }
|
) }
|
||||||
|
|||||||
Reference in New Issue
Block a user