Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev --> master #1990

Merged
merged 51 commits into from
Oct 28, 2016
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
58ed572
make syntax edit to build script
gemfarmer Sep 28, 2016
ac2afac
rebuild Gemfile.lock
gemfarmer Sep 28, 2016
98872d8
documentation related to serve commands
gemfarmer Sep 28, 2016
d7788e0
fix build errors by removing nightlybuild.sh
Oct 3, 2016
912523f
Correct name of Mississippi department (#1925)
Oct 6, 2016
1149713
Correct 50k to 30k (#1927)
Oct 6, 2016
7d15b37
updates ruby version to 2.3.1
Oct 12, 2016
7c4c78e
updates circle.yml file to specify ruby 2.3.1
Oct 12, 2016
da5e313
Merge pull request #1935 from 18F/ruby-version-update
gemfarmer Oct 12, 2016
70a8327
documentation updates
Oct 13, 2016
07bcd27
remove comment
Oct 13, 2016
493742d
minor edits to address notes
Oct 13, 2016
c8ef502
test circle config
gemfarmer Oct 5, 2016
464a086
site.url --> site.federalist_url
gemfarmer Oct 14, 2016
35e9fdd
Merge pull request #1924 from 18F/pa11y-ci-new
gemfarmer Oct 14, 2016
75608a4
added docker file and support
Oct 14, 2016
d3695f6
fix hound violation
Oct 14, 2016
321ada8
Merge branch 'dev' into new-serve-script
Oct 17, 2016
fa20b23
Merge branch 'new-serve-script' into dev
Oct 17, 2016
98f3979
Merge pull request #1919 from 18F/new-serve-script
Oct 17, 2016
26cfa39
updates contributing file
Oct 18, 2016
0dfb465
changed favicon to 18F logo
elainekamlley Oct 19, 2016
1a909ef
configure team as authors
gemfarmer Oct 20, 2016
6839625
playing around with redirects
gemfarmer Oct 20, 2016
a209557
add aaron redirect test and fix rubocop issues on redirect_collection.rb
Oct 20, 2016
8338cb7
add redirect_from urls and a ruby helper script to do it
Oct 21, 2016
fb0904f
fix encoding issues in serve command
Oct 24, 2016
83ee792
move redirect script to _scripts folder
Oct 24, 2016
105fc84
Added mark to team, authors
gemfarmer Oct 25, 2016
51d636d
fixing ruby dependancies
elainekamlley Oct 25, 2016
01815db
small change to trigger build
elainekamlley Oct 26, 2016
31a9e2c
add instructions in README on how to run the site using docker
Oct 26, 2016
1dd8f07
remove --trace command
Oct 26, 2016
93b6802
remove underscore on scripts folder
Oct 26, 2016
208b80a
add refined no such author error in authors.rb
Oct 26, 2016
bd78c06
add alumni attribute and fix hound/circleCI errors
Oct 26, 2016
f21fe47
fix deep linking error caught by HTML Proofer
Oct 26, 2016
1bf127b
new homepage content
Oct 27, 2016
0e85f19
Merge pull request #1945 from 18F/docker-support
gemfarmer Oct 27, 2016
26dfca7
Merge pull request #1984 from 18F/authors-archive
Oct 27, 2016
1071018
Merge branch 'favicon-fix' into dev
Oct 27, 2016
8fa93d7
Merge pull request #1985 from 18F/homepage-content
Oct 27, 2016
0940df4
bring in dev changes to mark-headd branch
Oct 28, 2016
1f498e2
moving to _authors folder
Oct 28, 2016
f2cb98f
Merge pull request #1974 from 18F/mark-headd-author
gboone Oct 28, 2016
1412d46
add headers redcarpet extension
Oct 25, 2016
e8cc3f9
Merge pull request #1986 from 18F/same-headers
gemfarmer Oct 28, 2016
3b705ee
add accessibility scanning to dev
Oct 28, 2016
068578a
removes test post and stray duplicate blogging guide
Oct 28, 2016
6061287
temporarily disable pa11y-ci
gemfarmer Oct 28, 2016
8ab5553
Merge pull request #1992 from 18F/disable-pa11y-ci
Oct 28, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 1 addition & 0 deletions .hound.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ jshint:

eslint:
enabled: true
config_file: .eslintrc
ignore_file: .eslintignore

ruby:
Expand Down
5 changes: 5 additions & 0 deletions .pa11yci
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"defaults": {
"hideElements": ".speakerdeck-iframe, twitterwidget, iframe, #rufous-sandbox, #instagram-media-payload-0"
}
}
131 changes: 131 additions & 0 deletions Accessibility Scanning Using Pa11y-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
## Accessibility Scanning Using Pa11y-ci

### Introduction

Building a website or application that is easy accessible toeveryone is not only an important of the user experience, but also a requirement of all federally funded projects. GSA provides a helpful [Section 508](https://section508.gov) portal. [Pa11y](https://github.com/pa11y/pa11y) is an automation tool that helps you scan your static web pages to check for accessibility problems and errors. It can be setup on your machine locally or remotely using a CI tool.

### Installation and setup(For MacOS)

1. [Concourse CI](https://concourse.ci/index.html) allows you to run multiple compliance scanning jobs on your machine using a virtual machine. It is highly recommended to go through its [excellent documentation and "Hello World" tutorial ](https://concourse.ci/hello-world.html) before writing custom jobs for your project.

2. If you want to run locally Pa11y-ci you will need to :

* install **vagrant** and **virtualbox** ](http://sourabhbajaj.com/mac-setup/Vagrant/README.html)
* use [The Fly CLI](https://concourse.ci/fly-cli.html) , a command line tool for Concourse which is used for a number of tasks from connecting to a shell in one of your build's containers to uploading new pipeline configuration into a running Concourse.

3. If you're on MacOS , you will have to `chmod +x` the downloaded binary and put it in your `$PATH`. This can be done in one fell swoop with `install path/to/fly /usr/local/bin/fly`

4. Run Vagrant

```sh
vagrant init concourse/lite # creates ./Vagrantfile
vagrant up # downloads the box and spins up the VM
```

5. Login into fly

`fly -t lite login -c http://192.168.100.4:8080`


### Running Pa11y-ci on your local machine

1. Create a `.yml` file containing the job with tasks that you want to run

`touch accessibility-scan.yml`

`vim accessibility-scan.yml`

```yml
jobs:
- name: accessibility-scan
plan:
- task: run-pa11y
config:
platform: linux
image_resource:
type: docker-image
source:
repository: node
run:
path: sh
args:
- -exc
- |
npm install -g pa11y-ci
npm install -g phantomjs
mkdir accessibility-scan
pa11y-ci --json --sitemap https://18f.gsa.gov/sitemap.xml > accessibility-scan/summary.txt
cat accessibility-scan/summary.txt
```

`type` is almost always going to be `docker-image` . `pa11y-ci` requires node, so we are using a `node` docker-image.

`run` section contains a series of shell command that we are executing:

* install pa11y-ci and phantomjsfrom the node package manager(npm)

* making a directory and telling pa11y-ci to pipe the results of the scan into a `json` file

the command is like so `pa11y-ci --json --sitemap https://[18f-static-site-url]/sitemap.xml > dir/file`

* printing the results in our CLI `cat…` (for debugging purposes, optional)

**Note that** we are using the `sitemap.xml` file instead of individual files(much more efficient)

2. Run

```shell
fly -t lite set-pipeline -p accessibility-scan -c accessibility-scan.yml
```

3. Go to the `URL` displayed on your CLI. **Click the plus sign on top right corner and toggle side bar and press play on your pipeline**. Pipelines are posed by default.


### Running Pa11y-ci with CircleCI(experimental)

If you want to run Pa11y-ci per pull request on your project:

1. Create a bash file `accessibility-scan.sh` in your project home directory to tell it to run either on a circleci supported branch or your localhost

```shell
if [[ -n $CIRCLE_BRANCH ]]; then

echo "scanning site using sitemap from 18F/${CIRCLE_BRANCH}"

pa11y-ci --sitemap https://federalist.18f.gov/preview/18F/18f.gsa.gov/${CIRCLE_BRANCH}/sitemap.xml

else

echo "scanning site using localhost sitemap"
pa11y-ci --sitemap http://localhost:4000/sitemap.xml
```

2. Modify your `circle.yml` to add pa11y-ci


```yaml
machine:
ruby:
version:
2.2.3

dependencies:
pre:
- [Your-other-commands]
- nvm install stable && nvm alias default stable
- npm test
- npm install -g pa11y-ci
test:
pre:
- bundle exec htmlproofer _site --disable-external --allow-hash-href --empty-alt-ignore --url-ignore [email protected]
- echo CIRCLE_BRANCH
- echo
- npm run --harmony accessibility-scan
```



### Adding Pa11y-ci in The Compliance Viewer(In Progress)
134 changes: 85 additions & 49 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,97 @@
This is a repo to design a beta version of 18f.gsa.gov based on the U.S.
Web Design Standards and with a complete refresh of much of the content.

## Where Contributions Go

Thanks for planning to contribute. Please read the below guidelines to know what to expect before submitting a contribution. Submit contributions to https://github.com/18F/18f.gsa.gov as pull requests to the `master` branch. 18F team members should submit pull requests from a branch. Outside contributors will need to fork this repo.

## Front end architecture
### CSS
- Styling will be built from the US Web Design Standards.
- CSS methodology will be inherited from the WDS, which inherits mostly from the [18f front end guide](https://pages.18f.gov/frontend/css-coding-styleguide/architecture/).
- Use [18F modifed BEM naming convention](https://pages.18f.gov/frontend/css-coding-styleguide/naming/)
- Componentized CSS: start with tag rules and only becomes more specific as necessary, using component classes.
- Will update the WDS library when it publishes a change required by the site. Otherwise will update bi-monthly (see #1877).
- The codebase will be visual regression tested when a suitable tool is found for 18F.
- The Sass code should be linted with `scss-lint` (see #1878)
- The [18F CSS linting configuration](https://raw.githubusercontent.com/18F/frontend/18f-pages-staging/.scss-lint.yml) will be used.
- If linting fails, it will also fail the tests, but not the build.
- Will default to [semantic HTML5](http://www.w3schools.com/html/html5_semantic_elements.asp).


### Images
- Will use `<svg>` and `xlink` (looking for link) for icons.
- All blog images should be under 800kb in total, un-minified size.
This document is about how to contribute to the 18f.gsa.gov site. This process looks a bit different depending on whether you’re a member of the public, an 18F employee, or a member of the outreach or site team. Here’s what you can find in this doc:

* [Public contributions](#public-contributions)
* [18F contributions](#18f-contributions)
- [Branches](#branches)
- [Front end architecture](#front-end-architecture)
- [Standards and benchmarks](#standards-and-benchmarks)
* [Public domain](#public-domain)

## Public contributions

We're so glad you're thinking about contributing to an 18F open source project! If you're unsure about anything, just [send us an email](mailto:[email protected]) with your question — or submit the issue or pull request anyway. The worst that can happen is you'll be politely asked to change something. We love all friendly contributions.

We want to ensure a welcoming environment for all of our projects. Our staff follow the [18F Code of Conduct](https://github.com/18F/code-of-conduct/blob/master/code-of-conduct.md) and all contributors should do the same.

We encourage you to read this project's CONTRIBUTING policy (you are here), its [LICENSE](LICENSE.md), and its [README](README.md).

* If you see an error or have feedback, the best way to let us know is to file an issue.
* To contribute a specific change to the site, outside contributors will need to fork this repo.

## 18F contributions

There is a team actively working on the site. You can find us in Slack in the #18f-site or #beta-18F-site channels (limited access).

### Branches

Any 18F team member should be able to make a branch of the site and submit a pull request. Doing so will also generate a preview URL we can use to inspect your changes.

Because new blog posts are published several times a week, we use several branches to manage parallel work in a predictable way:

* Submit **blog posts and minor content edits** as pull requests to the `master` branch.
* Submit **new design work, content changes, and features** as pull requests to the `dev` branch. This will allow us to test and review batches of changes before deploying them.

**The `master`, `staging`, and `production` branches are protected.** Only administrators of the repo can push directly to those branches. 18F teammates who don’t think they have the correct permissions should ask in the #18f-site channel.

### Merging pull requests

In your pull request (PR), tag anyone who should review the work and note what they should be reviewing. In general:

- Don’t merge your own PRs
- If your PR includes many small, incremental commits, consider squashing them
- Don’t merge until linters pass, unless reviewers approve exceptions

### Front end architecture

This site is based on the [U.S.
Web Design Standards](https://standards.usa.gov/) (WDS). It is developed using [Jekyll](https://jekyllrb.com/), a static site generator based on the Ruby programming language.

We default to using [semantic HTML5](http://www.w3schools.com/html/html5_semantic_elements.asp).

We use [HoundCI](https://houndci.com/) to automate Sass, JavaScript, and Ruby linting.

We use [CircleCI](https://circleci.com/) to run HTML Code Sniffer.

#### CSS

CSS methodology is inherited from the WDS, which inherits mostly from the [18f front end guide](https://pages.18f.gov/frontend/css-coding-styleguide/architecture/).

- Use [18F modifed BEM naming convention](https://pages.18f.gov/frontend/css-coding-styleguide/naming/)
- Componentized CSS: start with tag rules and only becomes more specific as necessary, using component classes

The 18F-site team will update the WDS library when it publishes a change required by the site; otherwise it will update bi-monthly (see [issue #1877](https://github.com/18F/18f.gsa.gov/issues/1877))

#### Images

- All icons should use `<svg>` and `xlink` (looking for link) formats
- All blog images should be under 800kb in total, un-minified size
- Images should be under 600Kb after being minified
- All raster images should be minified with a tool such as [grunt-imagemin](https://github.com/gruntjs/grunt-contrib-imagemin).
- All raster images should be minified with a tool such as [grunt-imagemin](https://github.com/gruntjs/grunt-contrib-imagemin)

#### JavaScript

### JavaScript
- The site will be developed with Jekyll so will have a ruby-based build.
- Is required to work without JavaScript.
- jQuery will be required for the WDS.
- No heavy JS framework is required.
- Should use the AirBnB linter configuration for JavaScript, if linting fails, it will also fail the tests, but not the build. (See: #1879)
- Ruby gems will be used for front end dependency management.
- JavaScript will not be bundled.
- There will be a manual testing script that will be required to walk through for each PR.
This site does not use any heavy JavaScript frameworks, and should always work without JavaScript.

- jQuery is included in the WDS
- Ruby gems is used for front end dependency management

### Devices
- All versions of IE that Microsoft supports; newest Chrome/FF.
- Mobile first will be employed.
- Every applicable change should be run through HTML code sniffer.
## Standards and benchmarks

### Device and browser support

- The website supports all versions of Internet Explorer still supported by Microsoft, as well as recent versions of Chrome, Safari, and Firefox
- The website should be designed with a mobile-first approach

### Performance
- Will measure against the following custom events:
- Time to blog post image
- Time to main image and callout text.
- Time til first blog post title shows up on page with all blog posts.
- Each of these should load in under a second

Each of the following events should load in under a second:

- Time to blog post image
- Time to main image and callout text
- Time until first blog post title shows up on page with all blog posts

## Public domain

This project is in the public domain within the United States, and
copyright and related rights in the work worldwide are waived through
the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/).
For detailed license information, see [LICENSE](LICENSE.md).

All contributions to this project will be released under the CC0
dedication. By submitting a pull request, you are agreeing to comply
with this waiver of copyright interest.
All contributions to this project will be released under the CC0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ruby:2.3.1

# set locales
RUN apt-get update >/dev/null && \
apt-get install -y locales >/dev/null && \
echo "en_US UTF-8" > /etc/locale.gen && \
locale-gen en_US.UTF-8 && \
export LANG=en_US.UTF-8 && \
export LANGUAGE=en_US:en && \
export LC_ALL=en_US.UTF-8

RUN curl -sL https://deb.nodesource.com/setup_4.x | bash - && \
apt-get install -y nodejs


COPY Gemfile Gemfile.lock /app/

RUN cd /app && gem install bundler && bundle install
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem "jekyll", '~> 3.1'
gem "html-proofer"

group :jekyll_plugins do
if ENV['FAST_BUILDS']
if ENV['FAST_BUILDS'] == 'true'
puts 'not using jekyll-archives because its sloooooooooow'
else
gem 'jekyll-archives', :git => 'https://github.com/jekyll/jekyll-archives.git'
Expand All @@ -22,6 +22,8 @@ group :jekyll_plugins do
gem 'jekyll-seo-tag'
end
gem 'jemoji'

group :development do
gem 'pry'
gem 'rb-readline'
end
Loading