This repository houses a microsite about 18F's portfolios. We use the U.S. Web Design System for the front end interface. The site is built and served through the Federalist platform.
To make it easier to eventually merge this microsite with the main 18F website, we're trying to maintain this repo as, effectively, a fork of the 18F repository. This means that
18f.gsa.gov extends the U.S. Web Design System and 18F Brand guidelines to create a style that is professional, unique, and informative. The style guide, located at 18f.gsa.gov/styleguide/ documents the patterns and components used to create this theme.
Note: The Federalist platform does not support the use of a predefined SHOME environment variable which impacts the installation of the site's testing dependency pry (See the issue). In order to build the Federalist deployment and keep the tests working in CI, a Federalist specific gemfile (GemfileFederalist) was created to exclude the testing and development groups during install. The Federalist script in the package.json is run during the build time a creates a bundler config to install the GemfileFederalist dependencies and not the default Gemfile. Any updates to the production builds Gemfile should be included in the GemfileFederalist until a better fix is in place for the pry dependency or the Federalist platform.
Run each of the following steps to get the site up and running.
git clone [email protected]:18F/portfolioscd portfoliosbundle install./serve
To dramatically reduce the build time, there are two commands that you can run instead of ./serve:
./serve-portfolios: This will eliminate all content except for portfolio-specific pages../serve-fast: This will eliminate all of the blog posts and the search index, but generates all other pages../serve-blog: This will eliminate all but the latest three blog posts, but keeps the rest of the site intact.
You should be able to see the site at: http://127.0.0.1:4000/site/
Using Docker can make dependencies management easier, but can also slow down your build time. You can find out more in this discussion.
To try this out on MacOS:
- Install Docker Toolbox.
- Make sure Docker is running and
cdinto your project folder. - Run
docker-compose buildto build the docker image and its dependencies. You only need to build once, but if there was an error with the build , rebuild using the--no-cacheoption like sodocker-compose build --no-cacheto avoid using the old version of the docker image. - Run
docker-compose up. Note: if you want to run a single command and bypass yourDockerfilefor debugging purposes, you can do like sodocker-compose run app <COMMAND>(for instance, you can run bundledocker-compose run app bundle install). Our site is large, so this could take awhile. Specifically this command will hang onjekyll_pages_api_search: checking for Node.jsfor upwards of 30 minutes on first run. - Visit http://localhost:4000/site/ in your browser. Make sure that you include the trailing slash.
When adding a new tag in a blog post's tags key, you may need to add the new tag to the tests in the /tests/schema/tags.yml list. Note, this only applies to tags that have not already been added to the tag list.
The site is a static website with HTML, CSS, and Javascript. Deployments are done through Federalist.
- Federalist runs in its own organization and space in cloud.gov, which piggybacks on AWS GovCloud.
- Federalist Admin: https://federalist.18f.gov/.
- Federalist responds to a webhook on GitHub and runs Jekyll to generate static web files and puts them in an S3 bucket.
- We map portfolios.18f.gov URL to the S3 bucket.