From 5ffdbdfc4c420526a726f9bc55af6aa5bc4deadd Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 6 Jun 2020 00:55:45 -0400 Subject: [PATCH 1/9] first pass at conversion to uswds-jekyll (broken) --- .gitignore | 1 + Dockerfile | 8 ++- Gemfile | 7 ++- Gemfile.lock | 100 ++++++++++++++++++---------------- Rakefile | 7 --- _config.yml | 120 +++++------------------------------------ _data/header.yml | 4 ++ _data/navigation.yml | 62 +++++++++++++++++++++ assets/css/styles.scss | 4 -- 9 files changed, 142 insertions(+), 171 deletions(-) create mode 100644 _data/header.yml create mode 100644 _data/navigation.yml delete mode 100644 assets/css/styles.scss diff --git a/.gitignore b/.gitignore index 6dcd8e79..b71053ff 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ _test_site/ .sass-cache/ .DS_store .*.swp +.jekyll-cache/ .jekyll-metadata diff --git a/Dockerfile b/Dockerfile index 1c90a6a0..9d13bf4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,11 @@ -FROM starefossen/ruby-node:2-8 +FROM ruby:2.7 WORKDIR /usr/src/app COPY Gemfile Gemfile.lock ./ -RUN bundle install +RUN gem install bundler && \ + bundle install -# COPY . . - -# Set some other necessary ENVs ENV LC_ALL=C.UTF-8 CMD bundle exec jekyll serve --host 0.0.0.0 --incremental diff --git a/Gemfile b/Gemfile index 6fc6a82a..303534c6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,14 +1,13 @@ source 'https://rubygems.org' -# https://github.com/18F/jekyll_pages_api_search/issues/37 -gem 'jekyll', '~> 3.1.0' +gem 'jekyll' group :jekyll_plugins do - gem "guides_style_18f", :github => '18F/guides-style', :branch => 'v1.0.6' + gem 'uswds-jekyll', github: '18F/uswds-jekyll', branch: 'update-uswds-2.0' gem 'jekyll-redirect-from' end group :development, :test do - gem 'html-proofer', '~> 3.15' + gem 'html-proofer' gem 'rake' end diff --git a/Gemfile.lock b/Gemfile.lock index 71369b32..fec40f43 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,24 +1,26 @@ GIT - remote: git://github.com/18F/guides-style.git - revision: 5bc8289e08638edd311e62806de4b6fc5f2a0135 - branch: v1.0.6 + remote: https://github.com/18F/uswds-jekyll.git + revision: 7cf641447784b9769950bc15a21121a81ef29bea + branch: update-uswds-2.0 specs: - guides_style_18f (1.0.6) - jekyll - jekyll_pages_api - jekyll_pages_api_search - rouge - sass + uswds-jekyll (5.0.0) + jekyll (>= 4.0) GEM remote: https://rubygems.org/ specs: addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - colorator (0.1) + colorator (1.1.0) + concurrent-ruby (1.1.6) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) ethon (0.12.0) ffi (>= 1.3.0) - ffi (1.12.2) + eventmachine (1.2.7) + ffi (1.13.0) + forwardable-extended (2.6.0) html-proofer (3.15.3) addressable (~> 2.3) mercenary (~> 0.3) @@ -27,66 +29,74 @@ GEM rainbow (~> 3.0) typhoeus (~> 1.3) yell (~> 2.0) - htmlentities (4.3.4) - jekyll (3.1.6) - colorator (~> 0.1) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.3) - liquid (~> 3.0) - mercenary (~> 0.3.3) - rouge (~> 1.7) + http_parser.rb (0.6.0) + i18n (1.8.3) + concurrent-ruby (~> 1.0) + jekyll (4.1.0) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (~> 2.0) + jekyll-watch (~> 2.0) + kramdown (~> 2.1) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (~> 0.4.0) + pathutil (~> 0.9) + rouge (~> 3.0) safe_yaml (~> 1.0) - jekyll-redirect-from (0.11.0) - jekyll (>= 2.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-watch (1.5.1) + terminal-table (~> 1.8) + jekyll-redirect-from (0.16.0) + jekyll (>= 3.3, < 5.0) + jekyll-sass-converter (2.1.0) + sassc (> 2.0.1, < 3.0) + jekyll-watch (2.2.1) listen (~> 3.0) - jekyll_pages_api (0.1.6) - htmlentities (~> 4.3) - jekyll (>= 2.0, < 4.0) - jekyll_pages_api_search (0.5.0) - jekyll_pages_api (~> 0.1.4) - sass (~> 3.4) - kramdown (1.17.0) - liquid (3.0.6) + kramdown (2.2.1) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.3) listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) + mercenary (0.4.0) mini_portile2 (2.4.0) nokogiri (1.10.9) mini_portile2 (~> 2.4.0) nokogumbo (2.0.2) nokogiri (~> 1.8, >= 1.8.4) parallel (1.19.1) + pathutil (0.16.2) + forwardable-extended (~> 2.6) public_suffix (4.0.5) rainbow (3.0.0) rake (13.0.1) - rb-fsevent (0.10.3) + rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) - rouge (1.11.1) + rexml (3.2.4) + rouge (3.19.0) safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) + sassc (2.4.0) + ffi (~> 1.9) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) typhoeus (1.4.0) ethon (>= 0.9.0) + unicode-display_width (1.7.0) yell (2.2.2) PLATFORMS ruby DEPENDENCIES - guides_style_18f! - html-proofer (~> 3.15) - jekyll (~> 3.1.0) + html-proofer + jekyll jekyll-redirect-from rake + uswds-jekyll! BUNDLED WITH - 1.17.3 + 2.1.4 diff --git a/Rakefile b/Rakefile index a8eaa247..ecf39225 100644 --- a/Rakefile +++ b/Rakefile @@ -1,10 +1,3 @@ -require 'guides_style_18f' - -desc "Update the 'navigation:' data in _config.yml" -task :update_nav do - GuidesStyle18F.update_navigation_configuration Dir.pwd -end - desc 'Build the site for testing' task :test_build do # https://github.com/jekyll/jekyll/issues/4122#issuecomment-159439360 diff --git a/_config.yml b/_config.yml index 0da130fe..c39d63c7 100644 --- a/_config.yml +++ b/_config.yml @@ -1,12 +1,13 @@ -name: Before you ship +title: Before You Ship +theme: uswds-jekyll exclude: -- CONTRIBUTING.md -- Gemfile -- Gemfile.lock -- LICENSE.md -- README.md -- go -- vendor/ + - CONTRIBUTING.md + - Gemfile + - Gemfile.lock + - LICENSE.md + - README.md + - go + - vendor/ permalink: pretty @@ -26,102 +27,10 @@ author: logourl: /assets/img/18f-logo.png logoalt: 18F logo -# Navigation -# List links that should appear in the site sidebar here -navigation: -- text: Overview - url: '' - internal: true -- text: Lifecycle of a Launch - url: ato/ - internal: true - children: - - text: Checklist - url: checklist/ - internal: true - - text: Types - url: types/ - internal: true - - text: System Security Plan - url: ssp/ - internal: true - - text: Archer - url: archer/ - internal: true - - text: Tips - url: tips/ - internal: true -- text: Security - url: security/ - internal: true - children: - - text: Scanning - url: scanning/ - internal: true - - text: Static Analysis - url: static-analysis/ - internal: true - - text: Dynamic Scanning - url: dynamic-scanning/ - internal: true - - text: Frameworks - url: frameworks/ - internal: true - - text: Multi-Factor Authentication - url: mfa/ - internal: true -- text: Infrastructure - url: infrastructure/ - internal: true - children: - - text: Sandbox Accounts - url: sandbox/ - internal: true - - text: Amazon Web Services - url: aws/ - internal: true - - text: Federalist - url: federalist/ - internal: true - - text: Good Production Practices - url: good-production-practices/ - internal: true - - text: Common Questions - url: common-questions/ - internal: true - - text: HTTPS Certificates - url: certs/ - internal: true - - text: Monitoring - url: monitoring/ - internal: true - - text: Pinning Dependencies - url: pinning-dependencies/ - internal: true - - text: Logging - url: logging/ - internal: true - - text: Decommissioning - url: decommissioning/ - internal: true -- text: Laws - url: laws/ - internal: true - children: - - text: 508 - Accessibility - url: 508/ - internal: true - - text: Paperwork Reduction Act (PRA) - url: https://pra.digital.gov/ - internal: false -- text: Privacy - url: privacy/ - internal: true - repos: -- name: Guides Template - description: Main repository - url: https://github.com/18F/before-you-ship + - name: Guides Template + description: Main repository + url: https://github.com/18F/before-you-ship google_analytics_ua: UA-48605964-19 @@ -138,11 +47,10 @@ collections: permalink: /:path/ defaults: - - - scope: + - scope: path: "" values: - layout: "guides_style_18f_default" + layout: "page" # Configuration for jekyll_pages_api_search plugin gem. jekyll_pages_api_search: diff --git a/_data/header.yml b/_data/header.yml new file mode 100644 index 00000000..43224801 --- /dev/null +++ b/_data/header.yml @@ -0,0 +1,4 @@ +usa_banner: true +type: extended +primary: + links: primary diff --git a/_data/navigation.yml b/_data/navigation.yml new file mode 100644 index 00000000..41a91481 --- /dev/null +++ b/_data/navigation.yml @@ -0,0 +1,62 @@ +primary: + - text: Overview + href: / + - text: Lifecycle of a Launch + href: /ato/ + links: + - text: Checklist + href: /ato/checklist/ + - text: Types + href: /ato/types/ + - text: System Security Plan + href: /ato/ssp/ + - text: Archer + href: /ato/archer/ + - text: Tips + href: /ato/tips/ + - text: Security + href: /security/ + links: + - text: Scanning + href: /security/scanning/ + - text: Static Analysis + href: /security/static-analysis/ + - text: Dynamic Scanning + href: /security/dynamic-scanning/ + - text: Frameworks + href: /security/frameworks/ + - text: Multi-Factor Authentication + href: /security/mfa/ + - text: Infrastructure + href: /infrastructure/ + links: + - text: Sandbox Accounts + href: /infrastructure/sandbox/ + - text: Amazon Web Services + href: /infrastructure/aws/ + - text: Federalist + href: /infrastructure/federalist/ + - text: Good Production Practices + href: /infrastructure/good-production-practices/ + - text: Common Questions + href: /infrastructure/common-questions/ + - text: HTTPS Certificates + href: /infrastructure/certs/ + - text: Monitoring + href: /infrastructure/monitoring/ + - text: Pinning Dependencies + href: /infrastructure/pinning-dependencies/ + - text: Logging + href: /infrastructure/logging/ + - text: Decommissioning + href: /infrastructure/decommissioning/ + - text: Laws + href: /laws/ + links: + - text: 508 - Accessibility + href: /laws/508/ + - text: Paperwork Reduction Act (PRA) + href: https://pra.digital.gov/ + external: true + - text: Privacy + href: /privacy/ diff --git a/assets/css/styles.scss b/assets/css/styles.scss deleted file mode 100644 index 00203837..00000000 --- a/assets/css/styles.scss +++ /dev/null @@ -1,4 +0,0 @@ ---- ---- - -@import "guides_style_18f"; From 1d78639cdfd1a1ba0e46f6c89e366bcbb55d9ea8 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 6 Jun 2020 01:11:27 -0400 Subject: [PATCH 2/9] remove a bunch of unused config --- _config.yml | 45 +++++++-------------------------------------- 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/_config.yml b/_config.yml index c39d63c7..fd200244 100644 --- a/_config.yml +++ b/_config.yml @@ -6,38 +6,24 @@ exclude: - Gemfile.lock - LICENSE.md - README.md - - go - vendor/ permalink: pretty -markdown: kramdown -kramdown: - input: GFM - sass: style: :compressed -# Author/Organization info to be displayed in the templates -author: - name: 18F - url: https://18f.gsa.gov - -# Point the logo URL at a file in your repo or hosted elsewhere by your organization -logourl: /assets/img/18f-logo.png -logoalt: 18F logo +logos: + - src: /assets/img/18f-logo.png + alt: 18F logo -repos: - - name: Guides Template - description: Main repository - url: https://github.com/18F/before-you-ship +github_info: + organization: 18F + repository: before-you-ship + default_branch: master google_analytics_ua: UA-48605964-19 -back_link: - url: "https://18f.gsa.gov/guides/" - text: Read more 18F guides - styles: - assets/css/custom.css @@ -51,20 +37,3 @@ defaults: path: "" values: layout: "page" - -# Configuration for jekyll_pages_api_search plugin gem. -jekyll_pages_api_search: - # Uncomment this to speed up site generation while developing. - #skip_index: true - - # Each member of `index_fields` should correspond to a field generated by - # the jekyll_pages_api. It can hold an optional `boost` member as a signal - # to Lunr.js to weight the field more highly (default is 1). - index_fields: - title: - boost: 10 - tags: - boost: 10 - url: - boost: 5 - body: From 73697298f0d2bd0f653259cb3418002e4b45c4bd Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 6 Jun 2020 01:12:41 -0400 Subject: [PATCH 3/9] upgrade ruby in circleci --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4b4a115e..dc980a12 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: build: docker: - - image: starefossen/ruby-node:2-8 + - image: ruby:2.7 steps: - checkout - run: bundle From e7057390c32028f5d399ecc0213790b5e59b54b0 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 6 Jun 2020 01:26:31 -0400 Subject: [PATCH 4/9] add footer --- _config.yml | 6 +----- _data/footer.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 _data/footer.yml diff --git a/_config.yml b/_config.yml index fd200244..28acdc28 100644 --- a/_config.yml +++ b/_config.yml @@ -13,10 +13,6 @@ permalink: pretty sass: style: :compressed -logos: - - src: /assets/img/18f-logo.png - alt: 18F logo - github_info: organization: 18F repository: before-you-ship @@ -36,4 +32,4 @@ defaults: - scope: path: "" values: - layout: "page" + layout: page diff --git a/_data/footer.yml b/_data/footer.yml new file mode 100644 index 00000000..a60223b0 --- /dev/null +++ b/_data/footer.yml @@ -0,0 +1,8 @@ +type: default +heading: Technology Transformation Services (TTS) +edit_page: + text: Edit this page +contact: + contact_links: + - text: devops@gsa.gov + href: mailto:devops@gsa.gov From b3bdbac7ba0197ae4fbbf2b6a404a14ef7fb070e Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 6 Jun 2020 01:29:37 -0400 Subject: [PATCH 5/9] add top-level section pages to nav --- _data/navigation.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/_data/navigation.yml b/_data/navigation.yml index 41a91481..f35c0a64 100644 --- a/_data/navigation.yml +++ b/_data/navigation.yml @@ -2,8 +2,9 @@ primary: - text: Overview href: / - text: Lifecycle of a Launch - href: /ato/ links: + - text: ATOs + href: /ato/ - text: Checklist href: /ato/checklist/ - text: Types @@ -15,8 +16,9 @@ primary: - text: Tips href: /ato/tips/ - text: Security - href: /security/ links: + - text: General Security Standards + href: /security/ - text: Scanning href: /security/scanning/ - text: Static Analysis @@ -28,8 +30,9 @@ primary: - text: Multi-Factor Authentication href: /security/mfa/ - text: Infrastructure - href: /infrastructure/ links: + - text: Overview + href: /infrastructure/ - text: Sandbox Accounts href: /infrastructure/sandbox/ - text: Amazon Web Services @@ -51,8 +54,9 @@ primary: - text: Decommissioning href: /infrastructure/decommissioning/ - text: Laws - href: /laws/ links: + - text: Overview + href: /laws/ - text: 508 - Accessibility href: /laws/508/ - text: Paperwork Reduction Act (PRA) From e6aa33cc9d2dc1a541c5d279bbb3e2c6107bfca6 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 6 Jun 2020 01:36:49 -0400 Subject: [PATCH 6/9] fix encoding in CircleCI --- .circleci/config.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index dc980a12..9062cc38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,9 @@ jobs: build: docker: - image: ruby:2.7 + environment: + # fix encoding + - LANG: C.UTF-8 steps: - checkout - run: bundle From 7f0662b4b5c284977dded15fe4ed5f155b98d116 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 6 Jun 2020 01:39:50 -0400 Subject: [PATCH 7/9] set ruby version for federalist --- .ruby-version | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..5588ae82 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.7.1 \ No newline at end of file From a207088198a88b897e344c164ea32220cc2d37d4 Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Sat, 6 Jun 2020 01:50:05 -0400 Subject: [PATCH 8/9] remove unused styles --- assets/css/custom.scss | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/assets/css/custom.scss b/assets/css/custom.scss index c3f1c19b..9b9cb48d 100644 --- a/assets/css/custom.scss +++ b/assets/css/custom.scss @@ -6,22 +6,3 @@ img.inline { max-width: 2em; vertical-align: middle; } - -.anchorjs-link { - border: none; -} - -/* USWDS positions checkboxes absolutely and hides them in favor of a styled - * :before element. We need to show disabled input boxes on the checklist page - * so that people can copy a checklist from markdown to GH and get the boxes. */ -#checklist-preview ~ ul input[type="checkbox"], -#checklist-preview ~ ol input[type="checkbox"] { - position: relative; - opacity: 1; - width: 1.8rem; - height: 1.8rem; - display: block; - margin: 0.3rem 0.6rem 0 0; - border-radius: 0.3rem; - float: left; -} From 13076fca9fccd90cda5865eaf4286519c5c2324a Mon Sep 17 00:00:00 2001 From: Hoaian Dang Date: Mon, 8 Jun 2020 08:06:08 -0700 Subject: [PATCH 9/9] add search.gov configurations --- _config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/_config.yml b/_config.yml index 28acdc28..7629a382 100644 --- a/_config.yml +++ b/_config.yml @@ -20,6 +20,8 @@ github_info: google_analytics_ua: UA-48605964-19 +search_site_handle: before-you-ship + styles: - assets/css/custom.css