GithubHelp home page GithubHelp logo

fullstackenviormentss / guides-style Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 18f/guides-style

0.0 2.0 0.0 2.38 MB

18F Guides Template style elements, derived from CFPB/DOCter

Home Page: https://rubygems.org/gems/guides_style_18f

License: Other

Ruby 31.72% HTML 7.04% CSS 55.12% JavaScript 6.12%

guides-style's Introduction

guides_style_18f: 18F Guides style gem

CircleCI

Provides consistent style elements for Jekyll-based web sites based on the 18F Guides Template. The 18F Guides theme is based on DOCter from CFPB.

Usage

In your Gemfile, include the following:

group :jekyll_plugins do
  gem 'guides_style_18f'
end

Add an assets/css/styles.scss file that contains at least the following:

---
---

@import "guides_style_18f";

Then in your _config.yml file, add the following (you may need to remove any layout: front matter from existing pages for this to take effect):

theme: guides_style_18f

defaults:
  -
    scope:
      path: ""
    values:
      layout: default

Build the site per usual, and observe the results.

Additional features

Here are some other features that can be enabled via _config.yml:

# To use the shared 18F Guides Teamplate assets when deploying to
# pages.18f.gov, to avoid having to rebuild the site for minor style and
# script updates:
asset_root: /guides-template

# This adds the "back to" breadcrumb link under the page title:
back_link:
  url: "https://pages.18f.gov/guides/"
  text: Read more 18F Guides

# If you use Analytics, add your code here:
google_analytics_ua: UA-????????-??

# If you want all of the navigation bar entries expanded by default, add this
# property and it to true:
expand_nav: true

Additional scripts and styles

If you'd like to add additional scripts or styles to every page on the site, you can add styles: and scripts: lists to _config.yml. To add them to a particular page, add these lists to the page's front matter.

Alternate navigation bar titles

If you want a page to have a different title in the navigation bar than that of the page itself, add a navtitle: property to the page's front matter:

---
title: Since brevity is the soul of wit, I'll be brief.
navtitle: Polonius's advice
---

Selectively expanding navigation bar items

If you wish to expand or contract specific navigation bar items, add the expand_nav: property to those items in the navigation: list in _config.yml. For example, the Update the config file entry will expand since the default expand_nav property is true, but Add a new page will remain collapsed:

expand_nav: true

navigation:
- text: Introduction
  internal: true
- text: Add a new page
  url: add-a-new-page/
  internal: true
  expand_nav: false
  children:
  - text: Make a child page
    url: make-a-child-page/
    internal: true
- text: Update the config file
  url: update-the-config-file/
  internal: true
  children:
  - text: Understanding the `baseurl:` property
    url: understanding-baseurl/
    internal: true

Search

There are two options for search.

jekyll_pages_api_search

Pros:

  • Generates a search index locally, which has the advantage of being self-contained. This means you can easily test search locally, on a staging site, etc.
  • Search results are shown in your site's layout

Cons:

  • Slows down your build

Usage: see the instructions.

search.gov

Pros:

  • A hosted service, so your site has fewer moving parts.
  • A more full-featured search engine
  • Search results show a preview of the text on the page, with highlighted term(s)
  • Provides analytics

Cons:

  • You need to register your site
  • Can't test search results locally

Usage:

  1. Register your site at search.gov.

  2. Add the following to your _config.yml:

    search_gov_handle: <your Site Handle from the search.gov Settings page>

Development

First, choose a Jekyll site you'd like to use to view the impact of your updates and clone its repository; then clone this repository into the same parent directory. For example, to use the 18F Guides Template:

$ git clone [email protected]:18F/guides-template.git
$ git clone [email protected]:18F/guides-style.git

In the Gemfile of the Jekyll site's repository, include the following:

group :jekyll_plugins do
  gem 'guides_style_18f', :path => '../guides-style'
end

then build the site with bundle exec jekyll serve. You can find the different style assets and templates within subdirectories of the assets and lib/guides_style_18f directories of this repository. Edit those, then rebuild the Jekyll site as usual to see the results.

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.

guides-style's People

Contributors

afeld avatar hbillings avatar mbland avatar wslack avatar ccostino avatar konklone avatar jmhooper avatar maya avatar jeremiak avatar thisisdano avatar el-mapache avatar arowla avatar jseppi avatar nickbristow avatar emileighoutlaw avatar jezhumble avatar jbarnicle avatar

Watchers

James Cloos avatar  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.