From 314c2454692f410e26fddd35ba86963c477bbe5d Mon Sep 17 00:00:00 2001 From: Evan Willhite Date: Wed, 21 Nov 2018 09:22:12 -0600 Subject: [PATCH] switched to yaml to get allthecomponents --- gulp-tasks/pa11y.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gulp-tasks/pa11y.js b/gulp-tasks/pa11y.js index ec4dcb5..a6f559e 100644 --- a/gulp-tasks/pa11y.js +++ b/gulp-tasks/pa11y.js @@ -64,13 +64,14 @@ function pa11yTest(path, browserSync, config) { fs.readdir(fileDir, (err, items) => { items.forEach((item) => { - if (item.split('.').pop() === 'twig' && item.charAt(0) !== '_') { + // Select components based on YAML files. + if (item.split('.').pop() === 'yml') { // Change array to string separated by dash. const twigFilePath = `${fileDir}/${item}`; const twigFilePlPath = twigFilePath.split('_patterns/').pop(); const filetoArray = twigFilePlPath.split('/'); const arraytoPath = filetoArray.join('-'); - const arraytoPathTweak = arraytoPath.slice(0, -5); + const arraytoPathTweak = arraytoPath.replace('~', '-').slice(0, -4); const pa11yPath = `${localUrl}patterns/${arraytoPathTweak}/${arraytoPathTweak}.html`; pa11yRun(pa11yPath, config); }