fixed build error, updated packages and astro, minor code updates

This commit is contained in:
2025-09-13 22:54:29 +02:00
parent 18f6df7c4d
commit b8eb2eb7bf
10 changed files with 12571 additions and 11154 deletions
+7 -1
View File
@@ -41,7 +41,13 @@ export const ComboBox = ({
<PhosphorIcon name="caret-down" />
</div>
{open && (
<div class={clsx('dropdown', cloak && 'invisible')} ref={el => el && setItemWidth(el.offsetWidth)}>
<div
class={clsx('dropdown', cloak && 'invisible')}
ref={el => {
if (!el) return
setItemWidth(el.offsetWidth)
}}
>
{Object.keys(children).map(key => (
<div
class="option"
+2 -2
View File
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'preact/hooks'
import { Funnel } from '@phosphor-icons/react'
import { FunnelIcon } from '@phosphor-icons/react'
import { marked } from 'marked'
import extendedLatex from '@/client/lib/marked-latex'
@@ -70,7 +70,7 @@ export const DomandeEsamiCourse = ({ course }: Props) => {
{courseTags.length > 1 && (
<div class="card filter">
<div class="grid-h">
<Funnel />
<FunnelIcon />
<strong>Filtra Tag</strong>
</div>
<div class="flex-row-wrap">
-1
View File
@@ -1,5 +1,4 @@
import { useState, useEffect } from 'preact/hooks'
import { render } from 'preact'
// Tipi per la gestione dei dati
type TipoStudente = 'triennale' | 'magistrale'
+2 -2
View File
@@ -9,7 +9,7 @@ const extBlock = options => ({
start(src) {
return src.match(/\$\$[^\$]/)?.index ?? -1
},
tokenizer(src, tokens) {
tokenizer(src, _tokens) {
const match = /^\$\$([^\$]+)\$\$/.exec(src)
return match ? { type: 'latex-block', raw: match[0], formula: match[1] } : undefined
},
@@ -25,7 +25,7 @@ const extInline = options => ({
start(src) {
return src.match(/\$[^\$]/)?.index ?? -1
},
tokenizer(src, tokens) {
tokenizer(src, _tokens) {
const match = /^\$([^\$]+)\$/.exec(src)
return match ? { type: 'latex', raw: match[0], formula: match[1] } : undefined
},
+12 -12
View File
@@ -32,17 +32,17 @@ const guidesCollection = defineCollection({
})
// Per ora sono su un sito a parte ma prima o poi verranno migrati qui
const seminariettiCollection = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
author: z.string(),
publishDate: z.date(),
eventDate: z.date(),
tags: z.array(z.string()),
}),
})
// const seminariettiCollection = defineCollection({
// type: 'content',
// schema: z.object({
// title: z.string(),
// description: z.string(),
// author: z.string(),
// publishDate: z.date(),
// eventDate: z.date(),
// tags: z.array(z.string()),
// }),
// })
const metaCollection = defineCollection({
type: 'content',
@@ -53,6 +53,6 @@ const metaCollection = defineCollection({
export const collections = {
news: newsCollection,
guides: guidesCollection,
seminarietti: seminariettiCollection,
// seminarietti: seminariettiCollection,
meta: metaCollection,
}
+6 -6
View File
@@ -11,16 +11,16 @@ Visti gli imminenti lavori che occuperanno l'aula studenti, ad inizio Settembre
<div class="grid-h-split">
<video controls>
<source src="https://static.phc.dm.unipi.it/timelapse-sud.mp4" type="video/mp4">
Your browser does not support the video tag.
<source src="https://static.phc.dm.unipi.it/timelapse-nord.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video controls>
<source src="https://static.phc.dm.unipi.it/timelapse-nord.mp4" type="video/mp4">
Your browser does not support the video tag.
<source src="https://static.phc.dm.unipi.it/timelapse-sud.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<video controls>
<source src="https://static.phc.dm.unipi.it/timelapse-termosifone.mp4" type="video/mp4">
Your browser does not support the video tag.
<source src="https://static.phc.dm.unipi.it/timelapse-termosifone.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</div>
View File
+11 -5
View File
@@ -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 (