From bce557cc2dc767628bed6aac87301a1be7c5431b Mon Sep 17 00:00:00 2001 From: rxliuli Date: Tue, 4 Nov 2025 05:03:50 +0800 Subject: init commit --- src/utils/seo/arcade-see-all-page.ts | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/utils/seo/arcade-see-all-page.ts (limited to 'src/utils/seo/arcade-see-all-page.ts') diff --git a/src/utils/seo/arcade-see-all-page.ts b/src/utils/seo/arcade-see-all-page.ts new file mode 100644 index 0000000..14d1474 --- /dev/null +++ b/src/utils/seo/arcade-see-all-page.ts @@ -0,0 +1,40 @@ +import type I18N from '@amp/web-apps-localization'; +import type { GenericPage } from '@jet-app/app-store/api/models'; +import type { SeoData } from '@amp/web-app-components/src/components/MetaTags/types'; +import { isAppTrailerLockupShelf } from '~/components/jet/shelf/AppTrailerLockupShelf.svelte'; + +export function seoDataForArcadeSeeAllPage( + page: GenericPage, + i18n: I18N, +): SeoData { + const titleWithSiteName = i18n.t( + 'ASE.Web.AppStore.Meta.TitleWithSiteName', + { + title: i18n.t('ASE.Web.AppStore.ArcadeSeeAll.Meta.Title'), + }, + ); + + const appNames = page.shelves + .filter(isAppTrailerLockupShelf) + .flatMap((shelf) => shelf.items) + .slice(0, 3) + .map((item) => item.title); + + const description = i18n.t( + 'ASE.Web.AppStore.ArcadeSeeAll.Meta.Description', + { + listing1: appNames[0], + listing2: appNames[1], + listing3: appNames[2], + }, + ); + + return { + pageTitle: titleWithSiteName, + socialTitle: titleWithSiteName, + appleTitle: titleWithSiteName, + description, + socialDescription: description, + appleDescription: description, + }; +} -- cgit v1.2.3