summaryrefslogtreecommitdiff
path: root/src/utils/seo/see-all-page.ts
diff options
context:
space:
mode:
authorrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
committerrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
commitbce557cc2dc767628bed6aac87301a1be7c5431b (patch)
treeb51a051228d01fe3306cd7626d4a96768aadb944 /src/utils/seo/see-all-page.ts
init commit
Diffstat (limited to 'src/utils/seo/see-all-page.ts')
-rw-r--r--src/utils/seo/see-all-page.ts47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/utils/seo/see-all-page.ts b/src/utils/seo/see-all-page.ts
new file mode 100644
index 0000000..bbdf369
--- /dev/null
+++ b/src/utils/seo/see-all-page.ts
@@ -0,0 +1,47 @@
+import type I18N from '@amp/web-apps-localization';
+import type { SeeAllPage } from '@jet-app/app-store/api/models';
+import type { SeoData } from '@amp/web-app-components/src/components/MetaTags/types';
+
+export function seoDataForSeeAllPage(page: SeeAllPage, i18n: I18N): SeoData {
+ let title = i18n.t('ASE.Web.AppStore.Meta.Product.Title');
+ const shelfName = {
+ reviews: 'productRatings',
+ 'customers-also-bought-apps': 'similarItems',
+ 'developer-other-apps': 'moreByDeveloper',
+ }[page.seeAllType];
+
+ if (shelfName) {
+ const shelf = page.shelfMapping[shelfName];
+ title = `${page.title} - ${shelf.title}`;
+ }
+
+ const titleWithSiteName = i18n.t(
+ 'ASE.Web.AppStore.Meta.TitleWithSiteName',
+ { title },
+ );
+
+ const descriptionLocKey =
+ {
+ reviews: 'ASE.Web.AppStore.SeeAll.Reviews.Meta.Description',
+ 'customers-also-bought-apps':
+ 'ASE.Web.AppStore.SeeAll.CustomersAlsoBoughtApps.Meta.Description',
+ 'developer-other-apps':
+ 'ASE.Web.AppStore.SeeAll.DeveloperOtherApps.Meta.Description',
+ }[page.seeAllType] ||
+ 'ASE.Web.AppStore.Meta.Product.DescriptionWithoutDeveloperName';
+ const description = i18n.t(descriptionLocKey, {
+ appName: page.title,
+ });
+
+ const artworkUrl = page.lockup.icon?.template;
+
+ return {
+ pageTitle: titleWithSiteName,
+ socialTitle: titleWithSiteName,
+ appleTitle: titleWithSiteName,
+ description,
+ socialDescription: description,
+ appleDescription: description,
+ artworkUrl,
+ };
+}