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.
- package/ChildCards.astro +5 -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
|
|
114
|
-
const indexEntry = (pages as any[]).find(p =>
|
|
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());
|