@@ -161,6 +161,16 @@ function set(obj, path, value) {
161161 return obj;
162162}
163163
164+/**
165+ * getLinksinSubdirs is written to provide a recursive index of posts
166+ * for nested directories for creating sidebars.
167+ * @param {string} path Absolute path to the subdirectory.
168+ * @returns {object} Nested object by directory with name of directory,
169+ * child pages (as an array of objects with title, .md filename, slug, and weight),
170+ * and subdirectories (named simply by the folder name). Iterate through the object
171+ * recursively.
172+ */
173+
164174export function getLinksinSubdirs(path) {
165175 const allFiles = getAllFiles(path);
166176 const fileTree = {};