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

This commit is contained in:
toom1996
2026-08-23 00:58:33 +08:00
parent c8d9735751
commit b274ccdfec
21 changed files with 612 additions and 380 deletions

View File

@ -4,14 +4,14 @@ import ComingSoon from "@/components/ComingSoon.astro"
import { toAbs } from "@/lib/api"
import { getI18n } from "@/i18n/utils"
import { href, PATH } from '@/lib/routes'
import { getSsgPopularBrands } from "@/lib/ssg"
import { getSsgPopularBrands } from "@/lib/api"
// 国际化:一行取当前语言 + 翻译函数
const { locale, t } = getI18n(Astro)
// 首页「热门品牌」区块:构建期(SSG 内部接口,server-only)拉取 20 个热门品牌,
// 封面/标题取自每个品牌代表走秀,直接烧入静态 HTML,运行期不再请求;后端不可达则静默留空(区块隐藏)。
// 具体 base 地址 + token 拼接已在 @/lib/ssg 内封装。
// 具体 base 地址 + token 拼接已在 @/lib/api 的 SSG 函数内封装。
const popular = await getSsgPopularBrands(20)
type GalleryItem = {

View File

@ -3,7 +3,7 @@ import type { RawArticle } from "@/lib/data"
import Breadcrumb from "@/components/Breadcrumb.astro"
import { getI18n } from "@/i18n/utils"
import { href, PATH } from '@/lib/routes'
import { ssrBase } from "@/lib/ssr"
import { ssrBase } from "@/lib/api"
interface Props {
article: RawArticle | null

View File

@ -1,7 +1,7 @@
---
import type { RawArticle } from "@/lib/data"
import Breadcrumb from "@/components/Breadcrumb.astro"
import { ssrBase } from "@/lib/ssr"
import { ssrBase } from "@/lib/api"
interface Props {
article: RawArticle | null

View File

@ -1,5 +1,7 @@
---
import { getSsgBrands, type SsgBrand } from "@/lib/ssg"
import { getSsgBrands, type SsgBrand } from "@/lib/api"
import { getI18n } from "@/i18n/utils"
import { href, PATH } from "@/lib/routes"
type Brand = SsgBrand
@ -11,7 +13,7 @@ type Brand = SsgBrand
// · 每个字母一行:左侧字母标签 + 右侧该字母下品牌名横向铺成多列
// · 无副标题、无数字 badge、无大字标题、无悬停黑底、无搜索框
// 构建期 SSR 拉数据走 SSG 内部接口 /api/ssg/brands(不对外暴露,位于独立内部端口 8091);
// base 地址 + token 拼接已在 @/lib/ssg 内封装。后端不可达则回落空数组(页面显示空索引)。
// base 地址 + token 拼接已在 @/lib/api 的 SSG 函数内封装。后端不可达则回落空数组(页面显示空索引)。
const { locale } = getI18n(Astro)
const brands = await getSsgBrands({ size: 300, only_with_articles: 1, featured: 1 })
const loadError = brands.length === 0