Skip to content

Commit

Permalink
Uses Parent Directory Instead of Naming index.md (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
redreceipt authored and danez committed Apr 2, 2019
1 parent 49d3aa4 commit 3605343
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions example/buildDocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ function buildDocs(api) {

function getComponentName(filepath) {
var name = path.basename(filepath);
// check for index.js
if (name === 'index.js') {
const dirs = path.dirname(filepath).split('/');
name = dirs[dirs.length - 1];
}
var ext;
while ((ext = path.extname(name))) {
name = name.substring(0, name.length - ext.length);
Expand Down

0 comments on commit 3605343

Please sign in to comment.