Skip to content

Digital.gov — Helping the government community deliver better digital services.

License

Notifications You must be signed in to change notification settings

Schultea/digitalgov.gov

 
 

Repository files navigation

Digital.gov Logo

We help people in government build better digital services

https://digital.gov

  • Sign-up for the [Digital.gov newsletter »]({{< ref "/about/subscribe.md" >}})
  • Follow us on Twitter »
  • Like our page on Facebook »

Want to learn more about how we work? Check out our Wiki page »


CircleCI

Development Guide

Digital.gov is built with Hugo and hosted by Federalist and Cloud.gov.

Install NPM Dependencies

npm install

Install Hugo 0.66.0

Read the HUGO quickstart guide »

For OSX: brew install hugo see https://gohugo.io/getting-started/installing/ for other OSs

Run

  1. Run hugo serve in the terminal
  2. wait 5-6 secs
  3. visit http://localhost:1313/

Other helpful HUGO commands:

  • hugo serve --templateMetricsHints — for seeing where you can apply caching in templates and speed up the build time See more »

Upgrading Hugo

  1. Read through the recent releases
  2. Run brew upgrade hugo to upgrade your local copy (docs).
  3. Set the version in the .hugo-version file. This is only used for telling Federalist which version of Hugo they should checkout and use.

Accessibility tests

We follow the WCAG2AA standard, and one of the ways we check that we're following the right rules is through automated tools, like pa11y. For more info on the rules being tested checkout the pa11y wiki.

Running tests

To run a web accessibility test on digital.gov do the following:

  1. Check out the site from GitHub https://github.com/GSA/digitalgov.gov/
  2. Install and run the site locally following the Install and Run instructions above. Site must be running locally to perform the scan.
  • If this is your first time running pa11y, then you'll need to run npm install to make sure pa11ly is installed.
  1. In a separate terminal window, run npm run test:pa11y to initiate the accessibility checker.

Note: Currently, this only runs accessiblity checks on the site home page as a Proof of Concept demonstration.

Accessibility testing configuration is located in the .pa11yci file.

Common Regex scripts

convert legacy-img to standard img

{{< legacy-img src="/\d+/\d+/\d{2,4}[-x]+\d{2,4}[_-]*(.+?)\.[pngje]+"( alt=".+?")* >}}
{{< img src="$1"$2 >}}

convert CDN links

{{< legacy-img src="/(\d{4,4})
{{< legacy-img src="$1

replace url with slug in posts

^url: .+/([^/]+)\.md
slug: $1

About

Digital.gov — Helping the government community deliver better digital services.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 58.4%
  • CSS 31.5%
  • JavaScript 10.1%