All Projects → 18F → federalist-uswds-gatsby

18F / federalist-uswds-gatsby

Licence: other
A template for Federalist that uses Gatsby and USWDS 2.0

Programming Languages

javascript
184084 projects - #8 most used programming language
SCSS
7915 projects

Projects that are alternatives of or similar to federalist-uswds-gatsby

dds.mil
The website of the Defense Digital Service.
Stars: ✭ 18 (-48.57%)
Mutual labels:  gatsby, uswds
krashna-site
Website for Krashna Musika - Student Society for Classical Music in Delft
Stars: ✭ 17 (-51.43%)
Mutual labels:  gatsby
federalist.18f.gov
Homepage for the Federalist platform
Stars: ✭ 28 (-20%)
Mutual labels:  federalist
roadbike
小书匠官网博客源码
Stars: ✭ 46 (+31.43%)
Mutual labels:  gatsby
atomic-state
Atomic State is a state management library for React
Stars: ✭ 15 (-57.14%)
Mutual labels:  gatsby
strapi-starter-gatsby-blog
Updated version of the first Gatsby starter with much more features
Stars: ✭ 140 (+300%)
Mutual labels:  gatsby
ficam-playbooks
The Federal Identity Credentials and Access Management program publishes guides and playbooks to help U.S. federal executive agencies implement, maintain, and modernize identity management systems.
Stars: ✭ 30 (-14.29%)
Mutual labels:  federalist
gatsby-theme-dox
Documentation made easy with Gatsby. 🎉
Stars: ✭ 29 (-17.14%)
Mutual labels:  gatsby
coronavirus-map-dashboard
🦠 Coronavirus (COVID-19) Map Dashboard using coronavirus-tracker-api
Stars: ✭ 41 (+17.14%)
Mutual labels:  gatsby
gatsby-theme-jam-example
An example submission for the Gatsby Theme Jam.
Stars: ✭ 89 (+154.29%)
Mutual labels:  gatsby
gatsby-starter-apple
🍎 Gatsby blog starter kit with beautiful responsive design
Stars: ✭ 88 (+151.43%)
Mutual labels:  gatsby
halo-lab
Website of the Halo lab: design and development agency
Stars: ✭ 32 (-8.57%)
Mutual labels:  gatsby
gatsby-plugin-open-graph-images
🖼 Open-Graph Images derived and generated from React Components
Stars: ✭ 16 (-54.29%)
Mutual labels:  gatsby
gatsby-remark-classes
Automatically add class attributes to markdown elements
Stars: ✭ 12 (-65.71%)
Mutual labels:  gatsby
gatsby-generator
🎰 Generate Gatsby Starters in Seconds
Stars: ✭ 23 (-34.29%)
Mutual labels:  gatsby
react-uswds
USWDS 3.0 components built in React
Stars: ✭ 108 (+208.57%)
Mutual labels:  uswds
my-personal-blog-gatsby
🙆🏻‍♀️ Welcome to the source code of my personal blog. This project was created with Gatsby and GraphQL 🌼
Stars: ✭ 43 (+22.86%)
Mutual labels:  gatsby
joeprevite.com
my digital garden 🌱
Stars: ✭ 31 (-11.43%)
Mutual labels:  gatsby
testimonial
Jamstack app using Gatsby, Netlify, and FaunaDB.
Stars: ✭ 23 (-34.29%)
Mutual labels:  gatsby
market
🧜‍♀️ THE Data Market
Stars: ✭ 149 (+325.71%)
Mutual labels:  gatsby

Dependabot Status

Federalist + U.S. Web Design System + Gatsby

This site 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 Federalist websites. You can view the preview deployed on Federalist.

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

This project assumes that you are comfortable editing source code. If you prefer to launch a website without editing any source code, checkout uswds-jekyll, which allows you to change the layout and content with configuration files.

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.

🖐Previous Versions 🖐

If you're looking for the original starter that included a more integrated approach to using USWDS with React, it is still available here, but will not be maintained.

Features

USWDS v2 javascript, styles, images, and fonts are included by default. Styles can be customized with either SASS or CSS in src/styles/index.scss.

Publish blog posts using Markdown. Any markdown files in the src/blog-posts directory will be turned into pages at /blog/<path> in the application using the src/templates/blog-post.js template, where <path> is specified in the frontmatter of the file. An index of all posts will be displayed at /blog using the src/templates/blog.js template.

Publish documentation pages using Markdown. Any markdown files in the src/documentation-pages directory will be turned into pages at /<path> in the application using the src/templates/documentation-page.js template, where <path> is specified in the frontmatter of the file. Side navigation for documentation pages can be controlled by setting sidenav: true or sidenav: false to your page front matter.

Publish custom pages using React. Any javascript files in the src/pages directory will be turned into pages at /<filename>.html, where <filename> is the actualy name of the file.

Customize SEO information for each page by adding the src/components/seo.js component to any page or template and providing the desired information. Ex. Home page.

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 gatsby-config.js. 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 the src/components/search-form.js component 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 gatsby-config.js.

Digital Analytics Program (DAP) integration - Once you have registered your site with DAP add your "agency" and optionally, subagency to gatsby-config.js 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 gatsby-config.js and uncomment the appropriate lines. Ex.

ga: {
    // ua: 'your-ua',
},

Out-of-the-box performant caching strategy following Gatsby recommended practices via federalist.json. See Federalist Documentation for more information on federalist.json.

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-gatsby#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-gatsby
$ cd federalist-uswds-gatsby

Running the application

With locally installed node

$ npm install
$ npm run develop

To build but not serve the site, run npm run build.

With Docker

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

To build but not serve the site, run:

docker-compose run node npm run build

.

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

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

Note: You'll also see a second link: http://localhost:8000/___graphql. This is a tool you can use to experiment with querying your data. Learn more about using this tool in the Gatsby tutorial.

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

Technologies you should be familiarize yourself with

🎓 Learning Gatsby

Looking for more guidance? Full documentation for Gatsby lives on the website. Here are some places to start:

  • For most developers, we recommend starting with our in-depth tutorial for creating a site with Gatsby. It starts with zero assumptions about your level of ability and walks through every step of the process.

  • To dive straight into code samples, head to our documentation. In particular, check out the Guides, API Reference, and Advanced Tutorials sections in the sidebar.

Things to Note

  • The Federalist script runs the Gatsby build with the --prefix-paths flag. This is necessary to make sure all internal internal links point to the correct path for preview deployments.
  • Always use the Link component provided by Gatsby for internal links, see previous note.
  • Importing USWDS images can be done straight from their local location in node_modules. See Banner.js for an example.
  • This is built from the default Gatsby default starter, you can view the documentation there to see more of what is included.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].