GSA / smartpay-website

SmartPay website
https://federalist-ab31a10d-375d-4040-9324-1ae94e8a36b9.sites.pages.cloud.gov/site/gsa/smartpay-website/
3 stars 0 forks source link
cloud-gov-pages

GSA SmartPayยฎ Website

This is the website for the GSA SmartPay program.

It is a statically-generated site built using Astro to run on cloud.gov pages.

๐Ÿš€ Project Structure

Inside of the project, you'll see the following folders and files:

/
โ”œโ”€โ”€ sass/              /* USWDS sass components */
โ”œโ”€โ”€ public/            /* Static, unprocessed assets (css, js, โ€ฆ) */
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ assets/        /* Sssets like images used in code */
โ”‚   โ””โ”€โ”€ config/        /* Extra js processing */
โ”‚   โ””โ”€โ”€ content/       /* Primary markdown content */
โ”‚   โ””โ”€โ”€ components/    /* Eeusable Astro components */
โ”‚   โ””โ”€โ”€ layouts/       /* Large astro components for pages */
โ”‚   โ””โ”€โ”€ pages/         /* This directorty maps to the urls of the site
โ”‚       โ””โ”€โ”€ about/
    โ”‚   โ””โ”€โ”€ ...
โ”‚   โ””โ”€โ”€ plugins/       /* Custom processing of markdown */ 
โ””โ”€โ”€ package.json

Astro looks for .astro or .md files in the src/pages/ directory. Each page is exposed as a route based on its file name.

There's nothing special about src/components/ or src/layouts but that's where we like to put any Astro components.

Any static assets, like images, can be placed in the public/ directory.

๐Ÿงž Commands

All commands are run from the root of the project, from a terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:3000
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying
npm run astro ... Run CLI commands like astro add, astro check
npm run astro -- --help Get help using the Astro CLI

๐Ÿ‡บ๐Ÿ‡ธ USWDS

This site uses the U.S. Web Design System (USWDS). To customize USWDS styles you will need to edit the SASS components and styles in the /sass directory. Changes here will not be reflected in the site until you rebuild the css. To build the css, run gulp:

npx gulp compile --gulpfile gulpfile.cjs

This will rebuild the static assests and place them in the /public directory. To learn more, visit USWDS Getting started for developers .

โ˜๏ธ Deploying to Cloud.gov Pages

Cloud.gov Pages manages the deployment of this site by watching for changes to the github repository. Changes to the main branch will be deployed to production. Changes to staging will be deployed to the demo site. For other branches Cloud.gov Pages will create a preview specific to that branch. See Pages Documentation for specific information.

๐Ÿ‘€ Want to learn more?

Astro documentation. Astro also maintains a helpful Discord server.