Coder Social home page Coder Social logo

cloud-gov / pages-uswds-jekyll Goto Github PK

View Code? Open in Web Editor NEW
37.0 10.0 46.0 3.1 MB

Reference implementation of USWDS 2.0 for Jekyll on Cloud.gov. Demo ->

Home Page: https://uswds-jekyll.pages.cloud.gov/

License: Other

HTML 42.35% Ruby 6.10% JavaScript 0.09% Dockerfile 0.47% SCSS 50.99%
federalist cloud-gov cloud-gov-pages

pages-uswds-jekyll's Introduction

CircleCI

Dependabot Status

Pages + U.S. Web Design System + Jekyll

This Jekyll theme is developed using the U.S. Web Design System v 2.0 and is focused on providing developers a starter kit and reference implementation for cloud.gov Pages websites.

This code uses the Jekyll site engine and built with Ruby. If you prefer to use Javascript, check out federalist-uswds-gatsby, which uses Gatsby site engine.

This project strives to be compliant with requirements set by 21st Century IDEA Act. The standards require that a website or digital service:

  • is accessible to individuals with disabilities;
  • has a consistent appearance;
  • does not duplicate any legacy websites (the legislation also requires agencies to ensure that legacy websites are regularly reviewed, removed, and consolidated);
  • has a search function;
  • uses an industry standard secure connection;
  • “is designed around user needs with data-driven analysis influencing management and development decisions, using qualitative and quantitative data to determine user goals, needs, and behaviors, and continually test the website, web-based form, web-based application, or digital service to ensure that user needs are addressed;”
  • allows for user customization; and
  • is mobile-friendly.

Comparison with uswds-jekyll

Both start off looking very similar, but differ in what use cases they are best for. Are you:

  • Wanting to have a starter template that you can highly customize?
  • Comfortable editing HTML and CSS source code?

use federalist-uswds-jekyll (this repository). If you:

  • Want to use a theme that you can set and forget
  • Are ok with sticking with the general look and feel provided

use uswds-jekyll.

Key Functionality

This repository contains the following examples and functionality:

✅ Publish blog posts, press releases, announcements, etc. To modify this code, check out blog/index.html, which manages how the posts are listed. You should then check out _layouts/post.html to see how individual posts are structured.

✅ Publish single one-off pages. Instead of creating lots of folders throughout the root directory, you should put single pages in _pages folder and change the permalink at the top of each page. Use sub-folders only when you really need to.

✅ Publish data (for example: job listings, links, references), you can use the template _layouts/data.html. Just create a file in you _pages folder with the following options:

---
title: Collections Page
layout: data
permalink: /collections
datafile: collections
---

The reference to datafile referers to the name of the file in _data/collections.yml and loops through the values. Feel free to modify this as needed.

✅ There are two different kinds of pages, one does not have a side bar navigation, and the other uses _includes/sidenav.html. You can enable this option by adding sidenav: true to your page front matter.

---
title: Document with Sidenav
layout: page
sidenav: true
permalink: /document-with-sidenav
---

Search.gov integration - Once you have registered and configured Search.gov for your site by following these instructions, add your "affiliate" and "access key" to _config.yml. Ex.

searchgov:

  # You should not change this.
  endpoint: https://search.usa.gov

  # replace this with your search.gov account
  affiliate: federalist-uswds-example

  # replace with your access key
  access_key: xX1gtb2RcnLbIYkHAcB6IaTRr4ZfN-p16ofcyUebeko=

  # this renders the results within the page instead of sending to user to search.gov
  inline: true

The logic for using Search.gov can be found in _includes/searchgov/form.html and supports displaying the results inline or sending the user to Search.gov the view the results. This setting defaults to "inline" but can be changed by setting

searchgov:
  inline: false

in _config.yml.

Digital Analytics Program (DAP) integration - Once you have registered your site with DAP add your "agency" and optionally, subagency to _config.yml and uncomment the appropriate lines. Ex.

dap:
  # agency: your-agency

  # Optional
  # subagency: your-subagency

Google Analytics integration - If you have a Google Analytics account to use, add your "ua" to _config.yml and uncomment the appropriate lines. Ex.

ga:
  # ua: your-ua

How to edit

  • Non-developers should focus on editing markdown content in the _posts and _pages folder

  • We try to keep configuration options to a minimum so you can easily change functionality. You should review _config.yml to see the options that are available to you. There are a few values on top that you need to change. They refer to the agency name and contact information. The rest of _config.yml has a range of more advanced options.

  • The assets/ folder stores your Javascript, CSS, images, and other media assets. Additional SASS partials should be added to the _sass/ folder where they can be imported. USWDS assets are automatically copied into the assets/ folder when running jekyll serve or jekyll build

  • If you look at package.json you will see that the npm run federalist command that will run when running on the Federalist platform.

  • Do not edit files in the _site/ folder. These files are auto-generated, and any change you make in the folder will be overwritten.

  • To edit the look and feel of the site, you need to edit files in _includes/ folder, which render key components, like the menu, side navigation, and logos.

  • index.html may not require much editing, depending on how you customize hero.html and highlights.html.

  • _layouts/ may require the least amount of editing of all the files since they are primarily responsible for printing the content.

  • blog/index.html can be edited, but be careful. It will impact the pagination system for the posts. If you do edit the file, be prepared to edit _config.yml. For example, you may need go change configurations for jekyll-paginate-v2

  • search/index.html is used by search.gov.

Getting Started

Easy mode

From Federalist

This will create a copy of this repo in a Github repository of your choice and add it to your Federalist dashboard.

  • From Federalist click the "+ Add Site" button.
  • Click the "Use this template" button for the appropriate template
  • Follow the instructions

From Github

This will create a copy of this repo in a Github repository of your choice but you will need to add it your Federalist dashboard.

  • Click the "Use this template" button above or here.
  • Follow the instructions
  • Return to Federalist and add the repository.

Hard mode

With npx (requires node)

$ npx degit https://github.com/18F/federalist-uswds-jekyll#main <destination-folder>
$ cd <destination-folder>

Push to your Github repository

    $ git init
    $ git symbolic-ref HEAD refs/heads/main
    $ git add . && git commit -m 'Initial commit'
    $ git remote add origin [email protected]:<your-org>/<your-repo>.git
    (Make sure to replace `<your-org>` and `<your-repo>` above with the correct values)
    $ git push -u origin main

Installation for development

$ git clone https://github.com/18F/federalist-uswds-jekyll
$ cd federalist-uswds-jekyll

Running the application

With locally installed node and ruby

$ npm install
$ bundle install
$ npm start 
OR
$ bundle exec jekyll serve

To build but not serve the site, run npm run build or bundle exec jekyll build.

With Docker

$ docker-compose run node npm install
$ docker-compose build
$ docker-compose up

To build but not serve the site, run:

docker-compose run ruby bundle exec jekyll build

.

Note that when built by Federalist, npm run federalist is used instead of npm run build.

Open your web browser to localhost:4000 to view your site.

Testing

With locally installed node and ruby

$ npm test
OR
$ bundle exec htmlproofer _site; npx a11y '_site/**/*.html'

With Docker

$ docker-compose run ruby bundle exec htmlproofer _site; npx a11y '_site/**/*.html'

Technologies you should be familiarize yourself with

  • Jekyll - The primary site engine that builds your code and content.
  • Front Matter - The top of each page/post includes keywords within -- tags. This is meta data that helps Jekyll build the site, but you can also use it to pass custom variables.
  • U.S. Web Design System v 2.0

Contributing

See CONTRIBUTING for additional information.

Public domain

This project is in the worldwide public domain. As stated in CONTRIBUTING:

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.

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.

pages-uswds-jekyll's People

Contributors

adborden avatar afeld avatar amanifarooque avatar amirbey avatar apburnes avatar davemcorwin avatar daveskender avatar dawnpm avatar dependabot-preview[bot] avatar dependabot[bot] avatar dmundra avatar drewbo avatar eddietejeda avatar hursey013 avatar mheadd avatar shumatepf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pages-uswds-jekyll's Issues

windows user can view site assets locally for uswds site

User Story

A Federalist user using a Windows operating system locally, can locally build their uswds based site and view their assets

Background (Optional)

Acceptance Criteria

  • can view assets locally on Windows machine
  • Change made live via deploy to federalist-uswds-jekyll

After evaluating, edit this part:

Level of effort - Low

Implementation outline (if higher than "low" effort):

Intermittent Jekyll or Sass Error After Updating to Ruby 2.7.5

I recently updated our site from Ruby 2.6.6 to Ruby 2.7.5 after I noticed 2.6.6 is security end of life 3/31/22. Our site is based on this repo. After making the upgrade, I noticed these intermittent errors and wondered if anyone else who used this template has noticed. It seems like the first build gets the below error, but if you rebuild the same branch it goes away.

Our layouts/base.html is the same as the one in this repo. Wondering if anyone else has noticed this or resolved it.

2022-02-09 16:28:03 INFO [build-jekyll] on line 152 of /tmp/work/site_repo/node_modules/uswds/dist/scss/core/_notifications.scss
2022-02-09 16:28:03 INFO [build-jekyll] from line 21 of /tmp/work/site_repo/node_modules/uswds/dist/scss/packages/_required.scss
2022-02-09 16:28:03 INFO [build-jekyll] from line 5 of /tmp/work/site_repo/node_modules/uswds/dist/scss/uswds.scss
2022-02-09 16:28:03 INFO [build-jekyll] from line 3 of /tmp/work/site_repo/_assets/css/index.scss
2022-02-09 16:28:04 INFO [build-jekyll] �[31m Liquid Exception: String can't be coerced into Integer in/_layouts/base.html�[0m
2022-02-09 16:28:04 INFO [build-jekyll] jekyll 3.9.1 | Error: String can't be coerced into Integer
2022-02-09 16:28:04 INFO [build-jekyll] /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/script/value/number.rb:409:in -': String can't be coerced into Integer (TypeError) 2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/script/value/number.rb:409:in basically_equal?'
2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/script/value/number.rb:403:in basically_equal?' 2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/script/value/number.rb:226:in eql?'
2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/script/functions.rb:2337:in has_key?' 2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/script/functions.rb:2337:in map_has_key'
2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/script/tree/funcall.rb:151:in block in _perform' 2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/stack.rb:108:in block in with_function'
2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/stack.rb:135:in with_frame' 2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/stack.rb:108:in with_function'
2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/script/tree/funcall.rb:149:in _perform' 2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/script/tree/node.rb:50:in perform'
2022-02-09 16:28:04 INFO [build-jekyll] from /usr/local/rvm/gems/ruby-2.7.5/gems/sass-3.7.4/lib/sass/tree/visitors/perform.rb:296:in `visit_if'
2022-02-09 16:28:04 ERROR [main] There was a problem running Jekyll, see the above logs for details.

sidenav.html needs more work please

I do not think the _includes/sidenav.html file is working as expected.

I had expected to find liquid loops {% for … and conditionals {% if … building the sidebar navigation iteratively for each page with sidenav: true set in the front matter. One main concern, I think, is that class="usa-current" should be assigned dynamically.

Canonical instructions are available here, but I am afraid this is all a bit too new to me for me at the moment. I will note that the primary navigation section of _config.yaml file makes sense to me and follows the model of those canonical instructions.

I will also note that the rendered page is odd in that it displays one “Current page”, one “Child link” and one “Grandchild link” all highlighted as the same time. I think that would be the expected behavior only if _pages/document_with_sidenav.md had its front matter title property set to “Grandchild Link”. As it is, the class="usa-current" bit is hard coded in three places in navbar.html. The static assignment of that class seems, to me, to be a mistake.

Please advise or provide a sample navbar.html that uses liquid examples.

Document how to use/customize the USWDS

USWDS in CSS form is great, but USWDS also provides a lot of SASS tools that can be used to theme and customize the USWDS. As a developer, how would I change my site to use the SASS version of USWDS instead of the CSS?

Docker Compose method does not work out of box without change to Gemfile

I could not get the page to build using the docker-compose method because of this issue:
https://stackoverflow.com/questions/9202324/execjs-could-not-find-a-javascript-runtime-but-execjs-and-therubyracer-are-in

I only could solve it by using the suggestion by stevec, modifying my Gemfile to:

FROM ruby:3.1.3

RUN apt-get update && \
  apt-get install --reinstall -y locales && \
  sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
  locale-gen en_US.UTF-8

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US
ENV LC_ALL en_US.UTF-8

RUN mkdir -p /app

WORKDIR /app

COPY Gemfile /app
COPY Gemfile.lock /app

RUN apt-get update
RUN apt-get install nodejs -y
RUN gem install bundler:1.17.2
RUN bundle install

EXPOSE 4000

Unsure if this the right way to go about it, however.

Transient jekyll starter build issues

User Story

As a user I want builds to succeed consistently when there are no problems.

Background (Optional)

https://federalistapp.18f.gov/sites/559/builds/215487/logs

2021-11-16 17:52:43 INFO [build-jekyll] on line 139 of /tmp/work/site_repo/node_modules/uswds/dist/scss/core/_notifications.scss
2021-11-16 17:52:43 INFO [build-jekyll] from line 21 of /tmp/work/site_repo/node_modules/uswds/dist/scss/packages/_required.scss
2021-11-16 17:52:43 INFO [build-jekyll] from line 5 of /tmp/work/site_repo/node_modules/uswds/dist/scss/uswds.scss
2021-11-16 17:52:43 INFO [build-jekyll] from line 9 of /tmp/work/site_repo/_assets/css/index.scss
2021-11-16 17:52:44 INFO [build-jekyll] �[31m Liquid Exception: String can't be coerced into Integer in /_layouts/base.html�[0m
2021-11-16 17:52:44 INFO [build-jekyll] jekyll 3.9.1 | Error: String can't be coerced into Integer
2021-11-16 17:52:44 INFO [build-jekyll] /usr/local/rvm/gems/ruby-2.7.4/gems/sass-3.7.4/lib/sass/script/value/number.rb:409:in `-': String can't be coerced into Integer (TypeError)
2021-11-16 17:52:44 INFO [build-je)

Acceptance Criteria

  • Builds don't randomly fail
  • Change made live via deploy of starter.

Level of effort - low

Implementation outline (if higher than "low" effort):

Banner chevron style conflict

The USWDS banner component chevron is not rendering correctly.

image

I can't entirely explain the root cause, but suspect it has something to do with the Jekyll compilation of CSS. There appears to be a conflict happening with .usa-banner__button::after in USWDS v2.12.x.

I've been able to resolve this problem with a workaround by adding mini_racer and jekyll-autoprefixer:

# GemFile
ruby '>= 2.7.4'

source "https://rubygems.org"

gem "jekyll", "~> 3.9"
gem "mini_racer" # --> added
gem "sprockets", "~> 3.7"
gem "kramdown-parser-gfm", "~> 1.1.0"

group :jekyll_plugins do
  gem "jekyll-feed", "~> 0.15"
  gem 'jekyll-redirect-from'
  gem 'jekyll-paginate-v2', "3.0.0"  
  gem 'jekyll-sitemap'
  gem 'jekyll-seo-tag'
  gem 'jekyll-autoprefixer'  # --> added
  gem "jekyll-assets", "~> 3.0", group: :jekyll_plugins
end

...
  • ⚠️ There are known issues with mini_racer that can be problematic - see https://github.com/rubyjs/mini_racer/issues/220

Separate Jekyll content from non-Jekyll files

Proposal: Move all the Jekyll site content (index.html, _layouts, _includes, assets, etc) to pages/ using the source configuration option and remove the _pages collection.

Some rationale:

  1. Jekyll has a built-in collection site.pages that contains all the pages in the site. Using _pages actually overrides that built-in collection.
  2. This avoids having pages like index.html in the root directory.
  3. The directory structure under pages/ mirrors the site structure making it easy to figure out where to edit page content.
  4. If you prefer a flat structure, you can still keep everything flat in pages/ and use permalink frontmatter.
  5. This keeps the Jekyll content separate from boilerplate files like README.md, Gemfile, node_modules, etc.
  6. This keeps the Jekyll build files separate from the npm build files in src/.
  7. This is similar to existing 18F templates used in the past (although they did not use the source configuration and specified permalink everywhere).

The structure ends up looking like this.

Remove CSS copy-based build step

@eddietejeda can we get rid of the css copy in the build step? Shouldn't we be encouraging people to use Jekyll's built-in sass compilation rather than working in CSS and then copying it over to assets? The Jekyll build will do that automatically.

Refactor non-inclusive language and terminology

Assignee

  • Move master branch to main:

    • git branch -m master main
    • git push -u origin main
  • Migrate code, content references, and links:

    • master -> main
    • whitelist -> allowlist
    • blacklist -> denylist
    • ???
  • [] Migrate CircleCI configuration and deploy scripts

  • Migrate Federalist configuration

  • Migrate branch protections

If default branch is master

  • [] Migrate Codeclimate configuration
  • Migrate Github default branch

All team members update local clones

  • Dave
  • Amir
  • Andrew
  • Eddie
  1. If you don't have the master branch pulled down locally, then there is nothing you need to do. You can check with git branch.

  2. If you do have the master branch pulled down locally
    Here are instructions for updating locally AFTER the changes have been made in Github, but I'm not totally sure if they are all necessary.

git checkout master
git branch -m master main
git fetch
git branch --unset-upstream
git branch -u origin/main
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main

Assignee (much later)

  • Deletemaster branch locally and in Github (optional)

Blog index page is not rendered

User Story

As a user of the template, I would like the blog pages index (or anything using the paginate plugin) to render.

Background (Optional)

starter preview url: https://federalist-71976045-72b8-456f-838d-26eeb0c707a3.app.cloud.gov/site/18f/federalist-uswds-jekyll/blog/

recently updated to Jekyll 4, reverting to Jekyll 3 fixes

Acceptance Criteria

  • All pages in the starter are rendered
  • Change made live via deploy starter.

After evaluating, edit this part:

Level of effort - <low/medium/high>

Implementation outline (if higher than "low" effort):

Research the implementation for an in-site search experience for search.gov

We implemented basic search.gov integration. However, we can provide a "richer" search experience by using the Search.gov API and rendering search results via JavaScript.

We should do some research to figure out how the search experience can be improved for users.

  • Identify user needs around search experience.
  • Create a new issue with implementation steps and acceptance criteria

Add Google Analytics Configuration

User Story

A user should be able to opt in to Google Analytics and the config for google analytics should lead interfacing with Google Analytics

Acceptance Criteria

  • activity is routed/reported to Google Analytics
  • Change made live via deploy of federalist-uswds-jekyll

Level of effort - low

Implementation outline (if higher than "low" effort):

  • re-add code for using the google analytics config to report to Google Analytics

Consider migrating away from `jekyll-assets`

Background (Optional)

@davemcorwin :
I really wanted this template to only depend on Ruby, but I just don't think it's possible, node just seems necessary, and we are still using it for netlify-cms and uswds.

Meanwhile activity on jekyll-assets seems to have stopped and support for Jekyll 4 is not complete. I think we should migrate away from jekyll-assets to a possibly more explicit way of handling SASS, JS and other assets.

Acceptance Criteria

  • jekyll assets is removed from the repo
  • replace with (sprockets, webpacker, rollup, parcel, esbuild, ...) ?
  • Change made live via deploy

After evaluating, edit this part:

Level of effort - <low/medium/high>

Implementation outline (if higher than "low" effort):

Update starter workflow

The current process/repo is not setup well for other folks to use as a starter. When users clone the repo, they inherit the entire git history of the starter AND the locked dependencies, which is not ideal. Provide a workflow that aligns better with use as a starter.

npm ci fails on first build for Node >= 16.15.1

The first build of this repo using npm ci and Node 16.15.1 or higher (npm v8.11.0) will fail:

npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm ERR!
npm ERR! Missing: [email protected] from lock file

Notes

  • Somewhere down the dependency chain, netlify-cms requires redux-notifications which requires an older version of redux (3.7.2) which isn't present in the lockfile. This causes npm ci to fail.
  • The same command succeeds on Node v.16.15.0 which uses npm 8.5.5. It's likely that the some type of dependency resolution/checking was changed between these npm versions which causes the build to fail

Acceptance Criteria

  • npm ci succeeds on this repository without any changes

Fix active state for Blog page nav link

Currently, the nav link does not show the "active" state when on the blog page (image below), it should. This is slightly complicated by the blog page living at blog/index.html instead of blog.html which the current logic in _includes/menu.html cannot handle.

blog

Pa11y and possible other dependency issues

The GitHub Action task for running pa11y is consistently failing. When upgrading pa11y to 3.0.1, the action passes but the tests still fail. I noticed this when the action triggered from dependabot bumping the pa11y version succeeded. Below is the task output for pa11y from that action:

Run npm run pa11y-ci:sitemap

> [email protected] pa11y-ci:sitemap /home/runner/work/uswds-site-sample/uswds-site-sample
> pa11y-ci --sitemap http://localhost:4000/sitemap.xml --sitemap-exclude "/*.pdf"  --sitemap-exclude "/admin"

Running Pa11y on 11 URLs:
 > http://localhost:4000/collections/ - Failed to run
 > http://localhost:4000/document-with-sidenav/ - Failed to run
 > http://localhost:4000/document/ - Failed to run
 > http://localhost:4000/201[9](https://github.com/shumatepf/uswds-site-sample/actions/runs/3735389750/jobs/6352134807#step:8:10)/01/[13](https://github.com/shumatepf/uswds-site-sample/actions/runs/3735389750/jobs/6352134807#step:8:14)/an-extra/ - Failed to run

This can be reproduced on any copy of the pages-uswds-jekyll template, including the one linked from the above action.

Implement search.gov based site search

As a developer, I would want documentation on how to use search.gov with the federalist-uswds-jekyll template so that I can provide site search on my Federalist site for my users.

  • Add a default search experience to the template with minimal configuration.
  • Document any steps that a developer would need to take to setup search.gov for their site.
  • Search results should be displayed within the site (not forwarded to search.gov).

First class support for Windows

I suspect that a lot of agency developers might be forced to use Windows machines, so our npm commands should support Windows. I think the best way to do that is to use a tool like gulp.js so that build tasks can be done in a cross-platform way.

News page visual design review

The USWDS doesn't currently have a blog page template. Bc of this, it might be good to review the design with a visual designer in the design lab.

Here's a previous design for search results page, which is pretty similar to a blog page: uswds/uswds#77

Avoid shipping USWDS SASS files to the finished site

We should copy the SASS files to _sass so they can be used at build time, but we don't want to ship them in the finished site.

Repro

  1. npm run build
  2. ls _site/assets/scss

Expected

scss directory does not exist

Actual

scss exists with all the SASS files.

`pa11y-ci` fixes for concurrency and runner problems

pa11y-ci accessibility tests fail intermittently. See pa11y/pa11y-ci#168 for more information. If this is a persistent problem, we'll need to fix this here too so it doesn't propagate to new Federalist sites.

https://github.com/18F/federalist-uswds-jekyll/blob/f543121a3578b84f72d9235eb43744fb0540d033/.pa11yci#L1-L7

My workaround is to change the configuration in .pa11yci to:

{
  "defaults": {
    "concurrency": 1,
    "standard": "WCAG2AA",
    "runners": ["htmlcs"]
  }
}

Missing author field?

I suspect admin/config.yml Posts collection YAML is missing an entry field for the post.author that is expected in _layouts/post.html. I haven't published this fix to test in my site, but seems likely.

Need to add the following to collections\..\fields:

  - {label: "Author", name: "author", widget: "string"}

USWDS dist/ folder not created automatically in build server

For some reason the USWDS library is not automatically built on the Federalist build server, although it works locally. This means that the dist/ is not created and the compiled assets are not available.

To resolve this, I step directly into the folder and run the build command.
83b2e18

Ideally, this would not be necessary.

Release federalist-uswds-jekyll 1.0

We will release 1.0 after the following issues are complete:

March 26, 2019
Prepare blog post to announce updated gem Moving to its own issue https://github.com/18F/federalist-uswds-jekyll/issues/34

  • Update USWDS package to use final beta version. thanks to @greensteph
  • Fix navigation bug

Remaining issues:

  • Govt banner logo is wrong - should be the flag
  • Link color is wrong - should be primary
  • Blog posts don’t link properly
  • Blue blog header should stretch to the full page width
  • “A tagline highlights your approach” doesn’t match the official example
  • homepage - “Stick to 6 or fewer words.” is in a different heading style
  • on the blog, don’t use text-light for the date, use normal text weight, if you want to differentiate the author, bold it
  • Pages fail a11y tests with too light of a gray text

Errors handling fonts and images during Jekyll build

When running the template locally I see a bunch of errors during the Jekyll build and fonts and images are not available in the site.

[2019-11-20 14:48:17] ERROR `/assets/img/angle-arrow-down-primary.svg' not found.
[2019-11-20 14:48:17] ERROR `/assets/fonts/source-sans-pro/sourcesanspro-regular-webfont.woff2' not found.
[2019-11-20 14:48:17] ERROR `/assets/img/angle-arrow-down.svg' not found.
[2019-11-20 14:48:17] ERROR `/assets/img/search.svg' not found.
[2019-11-20 14:48:17] ERROR `/assets/img/hero.png' not found.
[2019-11-20 14:48:17] ERROR `/assets/fonts/source-sans-pro/sourcesanspro-bold-webfont.woff2' not found.
[2019-11-20 14:48:17] ERROR `/assets/fonts/merriweather/Latin-Merriweather-Bold.woff2' not found.
[2019-11-20 14:48:17] ERROR `/assets/fonts/source-sans-pro/sourcesanspro-regular-webfont.woff' not found.
[2019-11-20 14:48:17] ERROR `/assets/fonts/merriweather/Latin-Merriweather-Bold.woff' not found.
[2019-11-20 14:48:17] ERROR `/assets/fonts/source-sans-pro/sourcesanspro-bold-webfont.woff' not found.
[2019-11-20 14:48:17] ERROR `/assets/fonts/source-sans-pro/sourcesanspro-bold-webfont.ttf' not found.
[2019-11-20 14:48:17] ERROR `/assets/fonts/source-sans-pro/sourcesanspro-regular-webfont.ttf' not found.
[2019-11-20 14:48:17] ERROR `/assets/fonts/merriweather/Latin-Merriweather-Bold.ttf' not found.
                    ...done in 9.326108 seconds.
                    
[2019-11-20 14:51:45] ERROR `/assets/img/angle-arrow-down-primary-hover.svg' not found.

Screen Shot 2019-11-20 at 2.58.18 PM.png

Investigate Jekyll pagination bug that caches reused components

When using Jekyll with the Paginator V2 plugin, shared components used in many collections get cached to just a single collection.

Acceptance Criteria

  • Investigate and identify the problem
  • Update the plugin to fix caching of components

Notes

Example on page two of CG news posts

Image

Small visual design adjustments

Here are a few small visual design adjustments that could help the template. In general, it looks great!

  • remove the padding-x from your div#blog for better mobile margins
  • for the blog description, try display-block.padding-top-1 and remove the bottom padding for better, more reliable spacing
  • add padding-bottom-4 to usa-layout-docs-sidenav to improve mobile spacing

And that's it!

Security Issues with Dependencies

Running npm audit on the repo shows several issues with some of the dependencies (see below). When a user forks this repo to create a new site in Federalist, and views the repo in their account / org they may see a security warning.

Screen Shot 2020-06-04 at 10 48 49 AM

npm audit results

                       === npm audit security report ===                        
                                                                                
# Run  npm update minimist --depth 7  to resolve 4 vulnerabilities
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ netlify-cms                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ netlify-cms > netlify-cms-app > netlify-cms-core >           │
│               │ react-hot-loader > loader-utils > json5 > minimist           │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1179                            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ a11y [dev]                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ a11y > meow > minimist                                       │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1179                            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ a11y [dev]                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ a11y > update-notifier > latest-version > package-json >     │
│               │ registry-auth-token > rc > minimist                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1179                            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ a11y [dev]                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ a11y > update-notifier > latest-version > package-json >     │
│               │ registry-url > rc > minimist                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1179                            │
└───────────────┴──────────────────────────────────────────────────────────────┘


# Run  npm update mkdirp --depth 7  to resolve 4 vulnerabilities
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ netlify-cms                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ netlify-cms > netlify-cms-app > netlify-cms-widget-code >    │
│               │ react-select > emotion > babel-plugin-emotion > mkdirp >     │
│               │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1179                            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ netlify-cms                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ netlify-cms > netlify-cms-app > netlify-cms-widget-markdown  │
│               │ > react-select > emotion > babel-plugin-emotion > mkdirp >   │
│               │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1179                            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ netlify-cms                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ netlify-cms > netlify-cms-app > netlify-cms-widget-relation  │
│               │ > react-select > emotion > babel-plugin-emotion > mkdirp >   │
│               │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1179                            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ netlify-cms                                                  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ netlify-cms > netlify-cms-app > netlify-cms-widget-select >  │
│               │ react-select > emotion > babel-plugin-emotion > mkdirp >     │
│               │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1179                            │
└───────────────┴──────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────────────────┐
│                                Manual Review                                 │
│            Some vulnerabilities require your attention to resolve            │
│                                                                              │
│         Visit https://go.npm.me/audit-guide for additional guidance          │
└──────────────────────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low           │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ minimist                                                     │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in    │ >=0.2.1 <1.0.0 || >=1.2.3                                    │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ a11y [dev]                                                   │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ a11y > phantomjs-prebuilt > extract-zip > mkdirp > minimist  │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1179                            │
└───────────────┴──────────────────────────────────────────────────────────────┘
found 9 low severity vulnerabilities in 711 scanned packages
  run `npm audit fix` to fix 8 of them.
  1 vulnerability requires manual review. See the full report for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.