diff --git a/content/templates/_components/c-example-2/01-button-test.pug b/content/templates/_components/c-example-2/01-button-test-03.pug similarity index 100% rename from content/templates/_components/c-example-2/01-button-test.pug rename to content/templates/_components/c-example-2/01-button-test-03.pug diff --git a/content/templates/_components/c-example-2/01-button-test.md b/content/templates/_components/c-example-2/01-button-test.md deleted file mode 100644 index 97ba5862..00000000 --- a/content/templates/_components/c-example-2/01-button-test.md +++ /dev/null @@ -1,3 +0,0 @@ ---- -title: Button test ---- \ No newline at end of file diff --git a/content/templates/_components/c-example-2/02-button-test.md b/content/templates/_components/c-example-2/02-button-test.md deleted file mode 100644 index a7679ef5..00000000 --- a/content/templates/_components/c-example-2/02-button-test.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Button test -source: Unofficial ---- \ No newline at end of file diff --git a/core/discovery/components.js b/core/discovery/components.js index 402751e1..8a775e6e 100755 --- a/core/discovery/components.js +++ b/core/discovery/components.js @@ -16,9 +16,9 @@ function autoHumanizedName(filename) { let fileNameParts = filename.split("-"); let humanizedNameParts = []; let humanizedName = ''; - fileNameParts.forEach((fileNamePart) => { - // If is not a number - if(!(/^\d+$/.test(fileNamePart))) { + fileNameParts.forEach((fileNamePart, index) => { + // If is not a number and not the first file name part + if( (!(/^\d+$/.test(fileNamePart))) || !(index == 0)) { // If is not a component category if(Object.keys(config.styleguide.componentCategories).indexOf(fileNamePart) === -1) { humanizedNameParts.push(fileNamePart); @@ -26,7 +26,7 @@ function autoHumanizedName(filename) { } }) - // Final name + // Final name humanizedName = humanizedNameParts.join(" "); // Capitalize first letter return humanizedName.substr(0,1).toUpperCase() + humanizedName.substr(1); @@ -40,7 +40,7 @@ function discover() { if (fs.existsSync(paths.content.templates.patterns)) { console.log(chalk.white.bgRed.bold('This project still uses the old `content/templates/_patterns/` directory.\nThis directory has been renamed to `content/templates/_components/`.\nPlease rename the folder in this project.\n')); } - + if (!config.styleguide) { return []; } @@ -118,4 +118,4 @@ function discover() { module.exports = { discover: discover -}; \ No newline at end of file +};