Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Commit

Permalink
switched to yaml to get allthecomponents
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Willhite committed Nov 21, 2018
1 parent 79a9c49 commit 314c245
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gulp-tasks/pa11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 314c245

Please sign in to comment.