Skip to content

Commit

Permalink
Merge pull request #2312 from 18F/dev
Browse files Browse the repository at this point in the history
Dev --> Master bonus round
  • Loading branch information
Corey Mahoney authored Feb 16, 2017
2 parents e7c9609 + 536ab49 commit bf2f680
Show file tree
Hide file tree
Showing 229 changed files with 523 additions and 133 deletions.
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ This site does not use any heavy JavaScript frameworks, and should always work w
- jQuery is included in the WDS
- Ruby gems is used for front end dependency management

## Accessibility

To test the site locally for accessibility errors, we use [pa11y-ci](https://github.com/pa11y/ci) to periodically test the site for accessibility concerns.

To set up, do the following:

1. `npm install`
2. `npm install -g pa11y-ci`
3. `npm run pa11y-ci local`

## Standards and benchmarks

### Device and browser support
Expand Down
2 changes: 1 addition & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Fixes issue(s) # .

[![CircleCI](https://circleci.com/gh/18F/18f.gsa.gov/tree/BRANCH_NAME.svg?style=svg)](https://circleci.com/gh/18F/18f.gsa.gov/tree/BRANCH_NAME)

[:sunglasses: PREVIEW](https://federalist.18f.gov/preview/18F/18f.gsa.gov/BRANCH_NAME/)
[:sunglasses: PREVIEW](https://federalist.fr.cloud.gov/preview/18f/18f.gsa.gov/BRANCH_NAME/)

Changes proposed in this pull request:
-
Expand Down
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# 18F’s flagship website

This repo houses the 18F website. We use the [Draft U.S. Web Design standards](https://standards.usa.gov/) as a front end framework. The site is built and served through [the Federalist platform](https://federalist.18f.gov).
This repo houses the 18F website. We use the [Draft U.S. Web Design standards](https://standards.usa.gov/) as a front end framework. The site is built and served through [the Federalist platform](https://federalist.fr.cloud.gov/).

### History

A detailed history of the work that went into developing this redesign can be found at [18F/beta.18f.gov](https://github.com/18F/beta.18f.gov). An archived copy of the original website can be found [on a Federalist preview](https://federalist.18f.gov/preview/18F/18f.gsa.gov/staging).
A detailed history of the work that went into developing this redesign can be found at [18F/beta.18f.gov](https://github.com/18F/beta.18f.gov).

## Installation

Expand Down Expand Up @@ -35,23 +35,13 @@ Using Docker can make dependencies management easier, but can also slow down you
3. Run `docker-compose build` to build the docker image and its dependencies. You only need to build once, but if there was an error with the build , rebuild using the `--no-cache` option like so `docker-compose build --no-cache` to avoid using the old version of the docker image.
4. Run `docker-compose up`.
Note: if you want to run a single command and bypass your `Dockerfile` for debugging purposes, you can do like so `docker-compose run app <COMMAND>` (for instance, you can run bundle `docker-compose run app bundle install`)
5. Visit [http://192.168.99.100:4000](http://192.168.99.100:4000/) in your browser.
5. Visit [http://192.168.99.100:4000](http://192.168.99.100:4000/site/) in your browser.

## System security controls

The site is a static website with HTML, CSS, and Javascript. Deployments are done through the Federalist platform.
The site is a static website with HTML, CSS, and Javascript. Deployments are done through Federalist.

1. Federalist runs in its own organization and space in CloudFoundry
1. Federalist Admin: https://federalist.18f.gov/
1. Using the Federalist editor that requires GitHub Oauth and writes commits as auth'd GitHub user, changes are then passed through a webhook back to Federalist
1. Federalist uses a CloudFoundry S3 service to write to the bucket, the Federalist instance only derives S3 credentials from the CloudFoundry S3 service and can only read/write to federalist.18f.gov/*
1. Federalist runs in its own organization and space in [cloud.gov](https://cloud.gov/), which piggybacks on [AWS GovCloud](https://aws.amazon.com/govcloud-us/)
1. Federalist Admin: https://federalist.fr.cloud.gov/
1. Federalist responds to a webhook on GitHub and runs Jekyll to generate static web files and puts them in an S3 bucket
1. We map 18f.gsa.gov URL to the S3 bucket

### Constraints

* We use Cloudfront to map 18f.gsa.gov to an S3 endpoint
* Federalist, and Cloudfront do not support the following HTTPS implementations:
* [HSTS Headers](https://github.com/18F/18f.gsa.gov/issues/1871)
* [HTTP/2](https://github.com/18F/18f.gsa.gov/issues/1872)
* [OSCP Stapling](https://github.com/18F/18f.gsa.gov/issues/292)
373 changes: 373 additions & 0 deletions _config-accesslint.yml

Large diffs are not rendered by default.

29 changes: 16 additions & 13 deletions _config-blog.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
env: "development"

---
env: development
exclude:
- .about.yml
- .cfignore
- .codeclimate.yml
- .gitignore
- .gitmodules
- .hound.yml
- _pages
- ".about.yml"
- ".cfignore"
- ".codeclimate.yml"
- ".gitignore"
- ".gitmodules"
- ".hound.yml"
- api-endpoints
- bin
- build
- circle.yml
- config_blog.rb
- CONTRIBUTING.md
- docker-compse.yml
- docker-compose.yml
- docker_entrypoint.rb
- Dockerfile
- examples/
Expand All @@ -22,6 +22,7 @@ exclude:
- Gemfile*
- humans.txt
- ISSUE_TEMPLATE.md
- killport
- LICENSE.md
- node_modules
- package.json
Expand All @@ -34,7 +35,7 @@ exclude:
- serve-blog
- serve-fast
- serve-accesslint
- sitemap.xml
- spec/
- system-security-plan.yml
- tests/
- tests/schema/tags.yml
Expand Down Expand Up @@ -316,7 +317,7 @@ exclude:
- _posts/2016-07-18-cloud-gov-full-steam-ahead-fedramp-assessment-process.md
- _posts/2016-07-19-strategies-for-starting-your-own-writing-lab.md
- _posts/2016-07-21-buying-better-digital-products-part-1-proto-personas-and-understanding-the-problem.md
- _posts/2016-07-22-building-emphathy-with-stakeholder-interviews-part-2-conversation.md
- _posts/2016-07-22-building-empathy-with-stakeholder-interviews-part-2-conversation.md
- _posts/2016-07-26-buying-better-digital-products-part-2-setting-the-product-vision-and-strategy.md
- _posts/2016-07-26-new-pilot-aims-to-streamline-notice-and-comment-process.md
- _posts/2016-07-28-bret-mogilefsky-finding-big-good-cloud-gov.md
Expand Down Expand Up @@ -347,7 +348,6 @@ exclude:
- _posts/2016-10-14-iterative-workplace-design-denver-federal-center.md
- _posts/2016-10-24-embracing-opportunities-to-improve-and-innovate.md
- _posts/2016-10-25-three-small-steps-you-can-take-to-reboot-agile-in-your-organization.md
- _posts/2016-07-22-building-empathy-with-stakeholder-interviews-part-2-conversation.md
- _posts/2016-10-26-writing-for-web-easy-writing-for-users-not.md
- _posts/2016-10-28-california-takes-new-approach-procurement.md
- _posts/2016-11-04-code-gov-the-next-milestone-federal-open-source-code.md
Expand All @@ -366,3 +366,6 @@ exclude:
- _posts/2017-01-05-building-effective-agile-partnership-between-government-industry.md
- _posts/2017-01-06-open-source-collaboration-across-agencies-to-improve-https-deployment.md
- _posts/2017-01-10-mark-hopson-negotiating-on-americas-behalf.md
- _posts/2017-01-11-the-best-way-to-build-big-is-to-start-small.md
---

7 changes: 4 additions & 3 deletions _config-fast-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@ jekyll_pages_api_search:
skip_index: true

env: "development"

exclude:
- .about.yml
- .cfignore
- .codeclimate.yml
- .gitignore
- .gitmodules
- .hound.yml
- _pages
- api-endpoints
- bin
- build
- circle.yml
- config_blog.rb
- CONTRIBUTING.md
- docker-compse.yml
- docker-compose.yml
- docker_entrypoint.rb
- Dockerfile
- examples/
Expand All @@ -30,6 +29,7 @@ exclude:
- Gemfile*
- humans.txt
- ISSUE_TEMPLATE.md
- killport
- LICENSE.md
- node_modules
- package.json
Expand All @@ -43,6 +43,7 @@ exclude:
- serve-fast
- serve-accesslint
- sitemap.xml
- spec/
- system-security-plan.yml
- tests/
- tests/schema/tags.yml
Expand Down
11 changes: 5 additions & 6 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,28 +123,27 @@ exclude:
- bin
- build
- circle.yml
- config_blog.rb
- CONTRIBUTING.md
- docker-compse.yml
- docker-compose.yml
- docker_entrypoint.rb
- Dockerfile
- examples/
- favicon.ico
- feed*
- Gemfile*
- humans.txt
- ISSUE_TEMPLATE.md
- killport
- LICENSE.md
- node_modules
- package.json
- pages/our-work.html
- PULL_REQUEST_TEMPLATE.md
- README.md
- robots.txt
- search-index*
- serve
- serve-blog
- serve-fast
- serve-accesslint
- sitemap.xml
- spec/
- system-security-plan.yml
- tests/
- tests/schema/tags.yml
Expand Down
5 changes: 2 additions & 3 deletions _includes/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@


{% if include.subnav %}
{% assign subnav_page_url = include.subnav_anchor | default: page.url %}
{% assign page_data = subnav_page_url | find_page: nav_items %}

{% if page.nav_items %}
{% include navigation/subnav.html
page_data=page
nav_items=nav_items
children=true
%}
{% else %}
{% assign subnav_page_url = include.subnav_anchor | default: page.url %}
{% assign page_data = subnav_page_url | find_page: nav_items %}
{% include navigation/subnav.html
page_data=page_data
children=true
Expand Down
10 changes: 3 additions & 7 deletions _plugins/author.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require 'pry'
require 'rb-readline'

module Jekyll
class AuthorTag < Liquid::Tag
def initialize(tag_name, author, tokens)
Expand All @@ -24,11 +21,11 @@ def render(_context)
end

def finder(group, name)
data = Jekyll.sites[0].data[group]
if results.respond_to?('find')
return results.find { |member| member['name'] == name }
else
require 'pry'; end
raise Exception, "No teammate found by that name: #{name}"
end
end
end

Expand All @@ -45,7 +42,6 @@ def initialize(tag_name, heading, tokens)
def render(context)
authored = []
author = context.environments[0]['page']['name']
full_name = context.environments[0]['page']['full_name']
first_name = context.environments[0]['page']['first_name']
posts = context.environments[0]['site']['posts']
site_url = context.environments[0]['site']['baseurl']
Expand Down Expand Up @@ -145,7 +141,7 @@ def team_link(input)
name = authors[index].data['name'].downcase
url = "#{site_url}/author/#{name}"
full_name = authors[index].data['full_name']
string = "<a class='post-author' itemprop='name' href='#{url}'>#{full_name}</a>"
"<a class='post-author' itemprop='name' href='#{url}'>#{full_name}</a>"
end
end
end
Expand Down
9 changes: 5 additions & 4 deletions _plugins/author_data.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
require 'yaml'
require 'rb-readline'
require 'pry'

module SiteData
class AuthorData
Expand All @@ -9,13 +7,16 @@ class AuthorData
def initialize(test_path = nil)
@test_path = test_path
@basepath = @test_path ? @test_path : Dir.pwd

@path = File.join(@basepath, '_authors')
cwd = File.dirname(__FILE__)
pwd = cwd.split('/')[0...-1].join('/')

@site_post_paths = Dir.entries(File.join(Dir.pwd, '_posts')).select do |f|
@site_post_paths = Dir.entries(File.join(pwd, '_posts')).select do |f|
!File.directory? f and f != '.DS_Store'
end

@all_authors = Dir.entries(File.join(Dir.pwd, '_authors')).select do |f|
@all_authors = Dir.entries(File.join(pwd, '_authors')).select do |f|
!File.directory? f and f != '.DS_Store'
end.flatten.uniq

Expand Down
26 changes: 16 additions & 10 deletions _plugins/related_posts.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'pry'
require 'rb-readline'
module Jekyll
class RelGenerator < Liquid::Tag
def initialize(related_posts, text, tokens)
Expand All @@ -10,11 +8,11 @@ def initialize(related_posts, text, tokens)

# Gets all posts from the site by tag and adds those that match the tags on
# the current page. Returns a flattened, deduped, array of post objects
def get_posts_by_tag(page, siteTags)
def get_posts_by_tag(page, site_tags)
tags = page['tags']
other_posts = []
for tag in tags
other_posts.push(siteTags[tag])
other_posts.push(site_tags[tag])
other_posts = other_posts.flatten.uniq
other_posts.delete_if { |post| page['title'] == post['title'] }
end
Expand All @@ -25,10 +23,15 @@ def get_posts_by_tag(page, siteTags)
# to other posts authored on the site. This may take a long time for large
# sites. Returns an array of posts
def get_posts_by_author(other_posts, page, site)
posts = site['posts']
if page['authors']
authors = page['authors']
authors.map { |author| posts.map { |post| if post.data['authors'] && post.data['authors'].index(author) then other_posts.push(post) end } }
authors.map do |author|
site['posts'].map do |post|
if post.data['authors'] && post.data['authors'].index(author)
then other_posts.push(post)
end
end
end
end
other_posts.delete_if { |post| page['title'] == post['title'] }
other_posts
Expand All @@ -40,7 +43,10 @@ def list_posts(other_posts)
internal = @params[1] || 'li'
if other_posts
related_posts = "<#{external}>"
other_posts.flatten.map { |post| related_posts << "<#{internal}><a href='#{@baseurl}#{post.url}' class='related_posts'>&ldquo;#{post.data['title']}&rdquo;</a></#{internal}>" }
other_posts.flatten.map do |post|
related_posts << "<#{internal}><a href='#{@baseurl}#{post.url}' \
class='related_posts'>&ldquo;#{post.data['title']}&rdquo;</a></#{internal}>"
end
related_posts << "</#{external}"
else
related_posts = '<p>No related posts</p>'
Expand All @@ -53,10 +59,10 @@ def list_posts(other_posts)
def render(context)
page = context['page']
site = context['site']
siteTags = site['tags']
other_posts = get_posts_by_tag(page, siteTags)
site_tags = site['tags']
other_posts = get_posts_by_tag(page, site_tags)
other_posts = get_posts_by_author(other_posts, page, site) if other_posts.flatten.length < 3
related_posts = list_posts(other_posts.uniq.take(3))
list_posts(other_posts.uniq.take(3))
end
end
end
Expand Down
3 changes: 0 additions & 3 deletions _plugins/utility.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
require 'pry'
require 'rb-readline'

module Jekyll
module Utility
attr_reader :match
Expand Down
2 changes: 2 additions & 0 deletions _projects/calc.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ tag: calc
expiration_date:
github_repo: https://github.com/18F/calc
project_url: "[CALC tool](https://calc.gsa.gov/)"
quote: CALC was built to save hours spent on market research and price analysis for federal government contracts, and has the potential to save millions of taxpayer dollars on services contracts.
quote_source: "Kelly Bailey, Product Owner of CALC, Federal Acquisition Service"
---

The General Services Administration (GSA) plays a central role in helping the rest of the federal government hire contractors to perform professional services. This process requires contracting officers to research past federal contracts to determine a fair hourly rate, which often involves manually searching through stacks of paper contracts to find old labor rates.
Expand Down
2 changes: 1 addition & 1 deletion _projects/dhs-myuscis.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ subtitle: Humanizing the process of becoming a citizen
permalink: /what-we-deliver/myuscis/
redirect_from: /project/dhs-myuscis/
excerpt: We worked with Citizenship and Immigration Services to make the process of applying for citizenship a little friendlier.
image: /assets/img/home/hero-immigration.png
image: /assets/img/home/hero-immigration.jpg
image_accessibility: "New citizens with their hands raised for the citizenship oath at a naturalization ceremony"
tag: uscis
project_url: "[myUSCIS website](https://my.uscis.gov/)"
Expand Down
2 changes: 1 addition & 1 deletion _projects/doi-every-kid-in-a-park.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ subtitle: Designing for every user
permalink: /what-we-deliver/every-kid-in-a-park/
redirect_from: /project/every-kid-in-a-park/
excerpt: We helped the Department of the Interior reach fourth graders and help kids discover public lands through the Every Kid in a Park program.
image: /assets/img/home/hero-ekiap.png
image: /assets/img/home/hero-ekiap.jpg
image_accessibility: Children proudly showing their national park badges
tag: every kid in a park
expiration_date:
Expand Down
Loading

0 comments on commit bf2f680

Please sign in to comment.