astro-better-cards 0.2.4 → 0.2.5

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.
Files changed (2) hide show
  1. package/ChildCards.astro +5 -2
  2. package/package.json +1 -1
package/ChildCards.astro CHANGED
@@ -110,8 +110,11 @@ if (depth === 1) {
110
110
  const subfolderNames = [...new Set(grandchildren.map(p => getSubfolder(p.id)))];
111
111
 
112
112
  groups = await Promise.all(subfolderNames.map(async sf => {
113
- const indexPath = prefix ? `${prefix}/${sf}/index` : `${sf}/index`;
114
- const indexEntry = (pages as any[]).find(p => stripExt(p.id) === indexPath);
113
+ const indexId = prefix ? `${prefix}/${sf}` : sf;
114
+ const indexEntry = (pages as any[]).find(p => {
115
+ const cid = stripExt(p.id);
116
+ return cid === indexId || cid === `${indexId}/index`;
117
+ });
115
118
  const sectionTitle: string = indexEntry
116
119
  ? await md(indexEntry.data.title)
117
120
  : sf.replace(/-/g, ' ').replace(/\b\w/g, (c: string) => c.toUpperCase());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-better-cards",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./Card.astro": "./Card.astro",