@aravindc26/velu 0.11.10 → 0.11.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aravindc26/velu",
3
- "version": "0.11.10",
3
+ "version": "0.11.12",
4
4
  "description": "A modern documentation site generator powered by Markdown and JSON configuration",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -936,21 +936,30 @@ export function getContextualOptions(): VeluContextualOption[] {
936
936
  const raw = config.contextual?.options;
937
937
 
938
938
  const ids = raw ?? DEFAULT_CONTEXTUAL_OPTIONS;
939
+ const options: VeluContextualOption[] = [];
939
940
 
940
- return ids.map((entry, index) => {
941
+ ids.forEach((entry, index) => {
941
942
  if (typeof entry === 'string') {
942
943
  const preset = CONTEXTUAL_PRESETS[entry];
943
- if (!preset) return null;
944
- return { id: entry, title: preset.title, description: preset.description, type: 'builtin' as const };
944
+ if (!preset) return;
945
+ options.push({ id: entry, title: preset.title, description: preset.description, type: 'builtin' });
946
+ return;
945
947
  }
946
- return {
948
+
949
+ const title = trimString(entry.title);
950
+ const href = trimString(entry.href);
951
+ if (!title || !href) return;
952
+
953
+ options.push({
947
954
  id: `custom-${index}`,
948
- title: entry.title,
949
- description: entry.description ?? '',
950
- href: entry.href,
951
- type: 'custom' as const,
952
- };
953
- }).filter((item): item is VeluContextualOption => item !== null);
955
+ title,
956
+ description: trimString(entry.description) ?? '',
957
+ href,
958
+ type: 'custom',
959
+ });
960
+ });
961
+
962
+ return options;
954
963
  }
955
964
 
956
965
  export function getSiteOrigin(): string {
package/src/validate.ts CHANGED
@@ -281,7 +281,7 @@ function collectPagesByLanguage(config: VeluConfig): Record<string, string[]> {
281
281
  return grouped;
282
282
  }
283
283
 
284
- grouped.english = basePages;
284
+ grouped.en = basePages;
285
285
  return grouped;
286
286
  }
287
287