diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts index aa31395..a601956 100644 --- a/src/i18n/i18n.ts +++ b/src/i18n/i18n.ts @@ -1,5 +1,5 @@ import type { WordingKey } from "src/i18n/wordings-keys"; -import type { ChronologyEvent, EndpointSource } from "src/shared/payload/payload-sdk"; +import type { EndpointChronologyEvent, EndpointSource } from "src/shared/payload/payload-sdk"; import { contextCache } from "src/utils/payload"; import { capitalize, formatInlineTitle } from "src/utils/format"; @@ -177,7 +177,7 @@ export const getI18n = async (locale: string) => { return number.toLocaleString(locale, options); }; - const formatTimelineDate = ({ year, month, day }: ChronologyEvent["date"]): string => { + const formatTimelineDate = ({ year, month, day }: EndpointChronologyEvent["date"]): string => { const date = new Date(0); date.setFullYear(year); if (month) date.setMonth(month - 1); diff --git a/src/pages/[locale]/images/[id].astro b/src/pages/[locale]/images/[id].astro index b7f78b9..731d241 100644 --- a/src/pages/[locale]/images/[id].astro +++ b/src/pages/[locale]/images/[id].astro @@ -27,7 +27,7 @@ const { height, } = image; -const { getLocalizedMatch, formatDate, t, formatFilesize } = await getI18n( +const { getLocalizedMatch, formatDate, t, formatFilesize, formatNumber } = await getI18n( Astro.locals.currentLocale ); @@ -56,7 +56,7 @@ const metaAttributes = [ { title: t("global.media.attributes.resolution"), icon: "material-symbols:photo-size-select-large", - values: [{ name: `${width} x ${height}` }], + values: [{ name: `${formatNumber(width)} x ${formatNumber(height)}` }], withBorder: false, }, { diff --git a/src/pages/[locale]/index.astro b/src/pages/[locale]/index.astro index 33813a3..26d54f9 100644 --- a/src/pages/[locale]/index.astro +++ b/src/pages/[locale]/index.astro @@ -143,19 +143,25 @@ const { t, getLocalizedUrl } = await getI18n(Astro.locals.currentLocale); margin-top: 64px; } - section { + section:not([hidden]) { + display: flex; + flex-direction: column; + gap: 24px; + + & > h2 { + margin-bottom: -12px; + } + + & > a { + width: fit-content + } + & > p { max-width: 35em; line-height: 1.5; - margin-top: 12px; - margin-bottom: 24px; } library { - & > a { - display: block; - margin-bottom: 24px; - } & > .grid { @media (max-width: 40rem) { diff --git a/src/pages/[locale]/timeline/_components/TimelineEvent.astro b/src/pages/[locale]/timeline/_components/TimelineEvent.astro index e1d651b..7d48fe4 100644 --- a/src/pages/[locale]/timeline/_components/TimelineEvent.astro +++ b/src/pages/[locale]/timeline/_components/TimelineEvent.astro @@ -2,6 +2,7 @@ import { getI18n } from "src/i18n/i18n"; import type { EndpointChronologyEvent } from "src/shared/payload/payload-sdk"; import TimelineEventPartial from "../../api/timeline/partial.astro"; +import { formatTimelineDateToId } from "src/utils/format"; interface Props { event: EndpointChronologyEvent; @@ -25,7 +26,7 @@ const multiple = displayDate && events.length > 1; {/* ------------------------------------------- HTML ------------------------------------------- */} -