Giter Site home page Giter Site logo

ishanshams / cfpb.github.io Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cfpb/cfpb.github.io

0.0 2.0 0.0 14.65 MB

A site for the CFPB to share and discuss its technology work with the world.

Home Page: https://cfpb.github.io/

License: Creative Commons Zero v1.0 Universal

Ruby 5.27% HTML 41.51% CSS 43.16% JavaScript 10.06%

cfpb.github.io's Introduction

A site for the CFPB to share and discuss its technology work with the world.

Running it locally

Content editors and developers probably want to set up cfpb.github.io on their local machine so they can preview updates without pushing to GitHub.

Before you get started make sure you have an up-to-date version of Ruby and Bundler. We use Homebrew:

brew install ruby
gem install bundler

As the site is intended to be deployed on GitHub Pages, installing the GitHub Pages gem is the best way to install Jekyll and related dependencies. Run the following command to install it:

bundle install

Note: As of 6/23/16, you may need to run this command before running bundle install to handle a bug in one of the dependencies:

bundle config build.nokogiri --use-system-libraries

Fork and clone the repo to your local machine.

From the project directory, run Jekyll:

bundle exec jekyll serve --watch --baseurl ''

Open it up in your browser: http://localhost:4000/

Working with the front end

The cfpb.github.io project front end currently uses the following:

  • Jekyll: Static site generator used by GitHub Pages.

_config.yml

Options within the _config.yml file allow you to control the site's title, subtitle, logo, author information, and the left column navigation.

Project Page URL Structure

This is an excerpt from the Jekyll docs on configuring your URL for Project Pages.

Sometimes it's nice to preview your Jekyll site before you push your gh-pages branch to GitHub. However, the subdirectory-like URL structure GitHub uses for Project Pages complicates the proper resolution of URLs. Here is an approach to utilizing the GitHub Project Page URL structure (username.github.io/project-name/) whilst maintaining the ability to preview your Jekyll site locally.

  1. In _config.yml, set the baseurl option to /project-name – note the leading slash and the absence of a trailing slash.
  2. When referencing JS or CSS files, do it like this: {{ site.baseurl }}/path/to/css.css – note the slash immediately following the variable (just before "path").
  3. When doing permalinks or internal links, do it like this: {{ site.baseurl }}{{ post.url }} – note that there is no slash between the two variables.
  4. Finally, if you'd like to preview your site before committing/deploying using jekyll serve, be sure to pass an empty string to the --baseurl option, so that you can view everything at localhost:4000 normally (without /project-name at the beginning): jekyll serve --baseurl ''

This way you can preview your site locally from the site root on localhost, but when GitHub generates your pages from the gh-pages branch all the URLs will start with /project-name and resolve properly.

Getting involved

We welcome your feedback and contributions. See the contribution guidelines for more details.

Note: Currently this file has standard language geared toward code contributions. Interested in contributing to design discussions? Just check out the issues and dive right in!


Open source licensing info

  1. TERMS
  2. LICENSE
  3. CFPB Source Code Policy

cfpb.github.io's People

Contributors

ascott1 avatar scotchester avatar marteki avatar marcesher avatar khandelwal avatar cfarm avatar ielerol avatar kimberlymunoz avatar willbarton avatar cmc333333 avatar virtix avatar stephanieosan avatar higs4281 avatar contolini avatar himedlooff avatar jimmynotjim avatar benguhin avatar konklone avatar burton avatar iuloshi avatar ssimpson avatar

Watchers

James Cloos avatar Ishan Shams avatar

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.