Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #75 from ginetta/v2/accessibility
Browse files Browse the repository at this point in the history
Adds accessibility audit task.
  • Loading branch information
lejoe committed Sep 28, 2015
2 parents f0a1c6b + 6b0b94c commit bd65d9b
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 13 deletions.
16 changes: 8 additions & 8 deletions gulp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ module.exports = function () {
};

var appFiles = {
scripts: paths.scripts.src + '**/*.js',
styles: paths.styles.src + '**/*.scss',
content: paths.content.src + '**/*.yml',
pages: paths.pages.src + '**/*.jade',
images: paths.images.src + '**/*',
logos: paths.logos.src + '**/*',
favicons: paths.favicons.src + '**/*',
fonts: paths.fonts.src + '**/*'
scripts: paths.scripts.src + '**/*.js',
styles: paths.styles.src + '**/*.scss',
content: paths.content.src + '**/*.yml',
pages: paths.pages.src + '**/*.jade',
images: paths.images.src + '**/*',
logos: paths.logos.src + '**/*',
favicons: paths.favicons.src + '**/*',
fonts: paths.fonts.src + '**/*'
};

var components = [
Expand Down
17 changes: 17 additions & 0 deletions gulp/tasks/accessibility.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
'use strict';

module.exports = function (gulp, $, config) {

var srcFiles = config.paths.pages.dest + '**/*.html';

return function () {
return gulp.src(srcFiles)
.pipe($.a11y())
.pipe($.a11y.reporter())
.pipe($.accessibility({
reportLevels: {
notice: false
}
}));
};
};
4 changes: 3 additions & 1 deletion gulp/tasks/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var path = require('path');
var pageshelpers = require('../utils/pagesHelpers');
var handleError = require('../utils/handleError');


module.exports = function (gulp, $, config) {
var srcFiles = config.appFiles.pages;
var destFiles = config.paths.pages.dest;
Expand Down Expand Up @@ -57,7 +58,8 @@ module.exports = function (gulp, $, config) {
return {
data: loadContent(language),
relativePath: getRelativePath(file, language),
helpers: moduleHelpers
helpers: moduleHelpers,
language: language
};
}))
.pipe($.jade({
Expand Down
12 changes: 12 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ gulp.task('deploy',
t.getTask('deploy'));


gulp.task('test',
'Tests the built project in terms of accessibility.',
['test:accessibility']);


///////////////
// Secondary //
///////////////
Expand Down Expand Up @@ -61,6 +66,13 @@ gulp.task('build:assets',
false,
t.getTask('assets'));


// Moves all the assets to the build
gulp.task('test:accessibility',
false,
['build'],
t.getTask('accessibility'));

// Cleans the build folder
gulp.task('clean',
false,
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"browser-sync": "^2.6.5",
"del": "^1.1.1",
"gulp": "^3.8.11",
"gulp-a11y": "^0.1.1",
"gulp-accessibility": "^1.2.1",
"gulp-autoprefixer": "^2.2.0",
"gulp-changed": "^1.2.1",
"gulp-concat": "^2.5.2",
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/default.jade
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
doctype html

html
html(lang=language)
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
Expand Down
3 changes: 2 additions & 1 deletion src/pages/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ include ../elements/**/*.jade
extends ../layouts/default

block meta
title project-name
//- TODO: add you page meta tags
block body
.about.l-absolute-centered
+header(data.index.header)
p!= helpers.markdown(data.index.content)
!= helpers.markdown(data.index.content)
3 changes: 1 addition & 2 deletions src/styles/_3.base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ body, html {
}

a {
color: $c-graphite;
text-decoration: none;
color: $c-silver;
}

.about {
Expand Down

0 comments on commit bd65d9b

Please sign in to comment.