mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-20 16:54:43 +08:00
docs: 优化文档显示 (#103)
This commit is contained in:
@@ -3,6 +3,8 @@ import url from 'node:url';
|
||||
import picocolors from 'picocolors';
|
||||
import { walk } from './file';
|
||||
import type { AppConfig, AppConfigMudule, SubscriptionConfig } from './types';
|
||||
import _ from 'lodash';
|
||||
import { pinyin } from 'pinyin-pro';
|
||||
|
||||
const apps: AppConfig[] = [];
|
||||
for await (const tsFp of walk(process.cwd() + '/src/apps')) {
|
||||
@@ -20,14 +22,16 @@ for await (const tsFp of walk(process.cwd() + '/src/apps')) {
|
||||
apps.push(appConfig);
|
||||
}
|
||||
|
||||
// a,b,c,d
|
||||
apps.sort((a, b) => (a.id > b.id ? 1 : -1));
|
||||
const subsConfig: SubscriptionConfig = {
|
||||
id: 0,
|
||||
name: '默认订阅',
|
||||
author: 'lisonge',
|
||||
supportUri: 'https://github.com/gkd-kit/subscription',
|
||||
apps,
|
||||
apps: _.sortBy(apps, (a) => {
|
||||
const pyName = pinyin(a.name, { separator: '', toneType: 'none' });
|
||||
if (pyName === a.name) return a.name;
|
||||
return '\uFFFF' + pyName; // 让带拼音的全排在后面
|
||||
}),
|
||||
};
|
||||
|
||||
export default subsConfig;
|
||||
|
||||
Reference in New Issue
Block a user