update
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
toom1996
2026-08-22 20:47:03 +08:00
parent 0df14036cf
commit c8d9735751
20 changed files with 228 additions and 125 deletions

View File

@ -2,7 +2,10 @@
import Layout from "@/layouts/Layout.astro"
import Breadcrumb from "@/components/Breadcrumb.astro"
import { getBrands, getYears, type BrandEntry } from "@/lib/api"
import { getI18n } from '@/i18n/utils'
import { clientHref, PATH, href } from '@/lib/routes'
const { locale } = getI18n(Astro)
let sidebarBrands: BrandEntry[] = []
let yearChips: number[] = []
@ -30,14 +33,14 @@ if (!yearChips.length) yearChips = yearSeed
} catch (e) {}
</script>
<div class="showsroot w-full" x-data="showsPage()">
<div class="showsroot w-full" x-data="showsPage()" data-locale={locale}>
<!-- 顶部:极简眉头 -->
<header class="showshead">
<div>
<Breadcrumb
items={[
{ label: 'Home', href: '/' },
{ label: 'Runway Archive', href: '/shows' },
{ label: 'Home', href: href(locale, PATH.home) },
{ label: 'Runway Archive', href: href(locale, PATH.shows) },
]}
>
<span slot="current" x-text="crumbYear">2026 Edition</span>
@ -201,7 +204,7 @@ if (!yearChips.length) yearChips = yearSeed
<!-- Card List -->
<template x-for="it in items" :key="it.id">
<a class="showscard" :href="`/article?id=${it.id}`" :aria-label="`${it.brand_name} ${it.title}`">
<a class="showscard" :href="articleHref(it)" :aria-label="`${it.brand_name} ${it.title}`">
<div class="showscard-left">
<div class="showscard-img" :class="{ 'is-loaded': it._imgLoaded }">
<span class="showsspin" aria-hidden="true" x-html="SPIN_SVG"></span>
@ -486,6 +489,7 @@ if (!yearChips.length) yearChips = yearSeed
return {
allBrands,
locale: '',
ICON_USER,
ICON_DATE,
SPIN_SVG,
@ -513,6 +517,7 @@ if (!yearChips.length) yearChips = yearSeed
reqToken: 0,
init() {
this.locale = this.$el.dataset.locale || 'en'
this.loadPage(1, false)
},
@ -684,6 +689,7 @@ if (!yearChips.length) yearChips = yearSeed
// 辅助辅助工具函数
toAbsUrl(url: string) { return toAbs(url) },
articleHref(it: { id: string | number }) { return clientHref(this.locale, PATH.article(it.id)) },
isNewAdded(pubAt?: number) { return Date.now() / 1000 - Number(pubAt || 0) < 60 * 60 * 24 * 14 },
fmtDate(ts: number) {
if (!ts) return ""