wayBetter for X 1.0.2

This commit is contained in:
CRTkafa 2026-10-02 02:54:04 +07:00
parent 7e2515aa42
commit 467aea2e28
212 changed files with 10208 additions and 2345 deletions

View file

@ -10,7 +10,7 @@ import type { ItemMedia } from './store-media.ts';
import type { AreaItem } from './areas.ts';
export type StoreItem = {
apps: string[]; kind: 'theme' | 'plugin' | 'strings'; language?: string; id: string; name: string; author: string; version: string; description: string;
apps: string[]; kind: 'theme' | 'plugin' | 'strings' | 'icons'; language?: string; id: string; name: string; author: string; version: string; description: string;
category: string; tags: string[]; url: string; file?: string; sha256: string; size: number; preview?: string;
permissions?: string[] | null; colors?: { bg: string; surface?: string; text: string; accent: string } | null;
license?: string; credits?: string;
@ -43,8 +43,8 @@ export type PageMeta = {
export const TITLE_MAX = 60;
export const DESCRIPTION_MIN = 50;
export const DESCRIPTION_MAX = 160;
export const KIND_FOLDER = { theme: 'themes', plugin: 'plugins', strings: 'strings' } as const;
export const KIND_LABEL = { theme: 'Theme', plugin: 'Plugin', strings: 'String pack' } as const;
export const KIND_FOLDER = { theme: 'themes', plugin: 'plugins', strings: 'strings', icons: 'icons' } as const;
export const KIND_LABEL = { theme: 'Theme', plugin: 'Plugin', strings: 'String pack', icons: 'Icon pack' } as const;
const STORE_IMAGE = '/og/store.png';
export const absolute = (path: string): string => `${SITE_URL}${path}`;
@ -122,7 +122,9 @@ export type PageOptions = {
};
/** Every page of the site in one language, with its meta data, in sitemap order. */
export function sitePages(catalog: Catalog, options: PageOptions = {}): PageMeta[] {
export function sitePages(signed: Catalog, options: PageOptions = {}): PageMeta[] {
// Built-in items (area plugins) are in the catalog for the app's Store only; the site has its own area pages.
const catalog: Catalog = { ...signed, items: signed.items.filter(item => (item.kind as string) !== 'builtin') };
const lang = options.lang ?? SOURCE_LANGUAGE;
const t = translator(lang);
const at = (path: string) => langPath(lang, path);