vitepress-allyouneed 0.3.1 → 0.3.2
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/dist/index.cjs +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/vitepress.cjs +3 -4
- package/dist/vitepress.cjs.map +1 -1
- package/dist/vitepress.js +3 -4
- package/dist/vitepress.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3103,10 +3103,9 @@ function generateFolderIndexes(options, folderOpts = {}) {
|
|
|
3103
3103
|
const strip = folderOpts.stripNumericPrefix ?? true;
|
|
3104
3104
|
const exclude = folderOpts.exclude ?? [];
|
|
3105
3105
|
const template = folderOpts.template ?? defaultTemplate;
|
|
3106
|
-
const dirsToProcess = collectDirs(srcDir, srcDir, viewsPrefix, exclude, mode);
|
|
3106
|
+
const dirsToProcess = [srcDir, ...collectDirs(srcDir, srcDir, viewsPrefix, exclude, mode)];
|
|
3107
3107
|
for (const dirAbs of dirsToProcess) {
|
|
3108
3108
|
const dirRel = import_node_path9.default.relative(srcDir, dirAbs).split(import_node_path9.default.sep).join("/");
|
|
3109
|
-
if (dirRel === "") continue;
|
|
3110
3109
|
const entries = safeReaddir(dirAbs);
|
|
3111
3110
|
if (entries.length === 0) continue;
|
|
3112
3111
|
const dirName = import_node_path9.default.basename(dirAbs).toLowerCase();
|
|
@@ -3169,11 +3168,11 @@ function generateFolderIndexes(options, folderOpts = {}) {
|
|
|
3169
3168
|
}
|
|
3170
3169
|
files.sort((a, b) => a.title.localeCompare(b.title));
|
|
3171
3170
|
subDirs.sort((a, b) => a.title.localeCompare(b.title));
|
|
3172
|
-
const lastSeg = dirRel.split("/").pop() ?? "";
|
|
3171
|
+
const lastSeg = dirRel === "" ? import_node_path9.default.basename(srcDir) : dirRel.split("/").pop() ?? "";
|
|
3173
3172
|
const ctx = {
|
|
3174
3173
|
dirAbsPath: dirAbs,
|
|
3175
3174
|
dirRelPath: dirRel,
|
|
3176
|
-
title: humanize2(lastSeg, strip),
|
|
3175
|
+
title: humanize2(lastSeg, strip) || "Home",
|
|
3177
3176
|
files,
|
|
3178
3177
|
subDirs
|
|
3179
3178
|
};
|