forked from phc/website
fixed build error, updated packages and astro, minor code updates
This commit is contained in:
+11
-5
@@ -11,7 +11,11 @@ import Card from '@/components/Card.astro'
|
||||
|
||||
const news = await getCollection('news')
|
||||
|
||||
const galleryCollage = await Astro.glob('@/assets/gallery/*.jpg')
|
||||
// const galleryCollage = await Astro.glob('@/assets/gallery/*.jpg')
|
||||
|
||||
const galleryCollage: { default: ImageMetadata }[] = Object.values(
|
||||
import.meta.glob('@/assets/gallery/*.jpg', { eager: true }),
|
||||
)
|
||||
---
|
||||
|
||||
<PageLayout title="PHC" pageTags="homepage">
|
||||
@@ -200,14 +204,16 @@ const galleryCollage = await Astro.glob('@/assets/gallery/*.jpg')
|
||||
{
|
||||
galleryCollage.map((module, i) => {
|
||||
const src = module.default.src
|
||||
const filename = src.split('/').at(-1).split('?').at(0).split('.').at(0)
|
||||
const filename = src.split('/').at(-1)?.split('?').at(0)?.split('.').at(0)
|
||||
|
||||
if (!filename) return null
|
||||
|
||||
const [rows, cols] = filename.includes('@')
|
||||
? filename
|
||||
? (filename
|
||||
.split('@')
|
||||
.at(-1)
|
||||
.split('x')
|
||||
.map((s: string) => parseInt(s))
|
||||
?.split('x')
|
||||
.map((s: string) => parseInt(s)) ?? [1, 1])
|
||||
: [1, 1]
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user