Skip to content

Commit

Permalink
Merge pull request #2094 from 18F/dev
Browse files Browse the repository at this point in the history
dev > master
  • Loading branch information
gboone authored Dec 5, 2016
2 parents 6aa18b8 + f8dcaa9 commit b861459
Show file tree
Hide file tree
Showing 16 changed files with 177 additions and 67 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ Run each of the following steps to get the site up and running.
3. `bundle install`
4. `./serve`

To enable the ability to search and see archives, you can run `bundle exec jekyll serve` instead of `./serve` for the server start command. This will **slow down rebuild times dramatically**, so use this command with discretion.
To enable the ability to search and see all pages related to the blog, you can run `bundle exec jekyll serve` instead of `./serve` for the server start command. This will **slow down rebuild times dramatically**, so use this command with discretion.

You should be able to see the site at: http://127.0.0.1:4000

## Alternative Installation using Docker
Using Docker can make dependencies management easier, but can also slow down your build time. You can find out more in
[this discussion](https://github.com/18F/18f.gsa.gov/pull/1688#issue-152998027)
Using Docker can make dependencies management easier, but can also slow down your build time. You can find out more in
[this discussion](https://github.com/18F/18f.gsa.gov/pull/1688#issue-152998027)

*To try this out on MacOS:*

1. Install [Docker Toolbox](https://www.docker.com/products/docker-toolbox).
2. Make sure Docker is running and `cd` into your project folder
3. Run `docker-compose build` to 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-cache` option like so `docker-compose build --no-cache` to avoid using the old version of the docker image.
4. Run `docker-compose up`.
Note: if you want to run a single command and bypass your `Dockerfile` for debugging purposes, you can do like so `docker-compose run app <COMMAND>` (for instance, you can run bundle `docker-compose run app bundle install`)
Note: if you want to run a single command and bypass your `Dockerfile` for debugging purposes, you can do like so `docker-compose run app <COMMAND>` (for instance, you can run bundle `docker-compose run app bundle install`)
5. Visit [http://192.168.99.100:4000](http://192.168.99.100:4000/) in your browser.

## System security controls
Expand Down
28 changes: 28 additions & 0 deletions _config-dev.yml
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
env: "development"

exclude:
- _pages
- _cards
- _posts
- _authors
- CONTRIBUTING.md
- README.md
- PULL_REQUEST_TEMPLATE.md
- ISSUE_TEMPLATE.md
- 'Accessibility Scanning Using Pa11y-ci.md'
- accessibility-scan
- api-endpoints
- build
- circle.yml
- docker-compse.yml
- docker_entrypoint.rb
- Dockerfile
- favicon.ico
- feed*
- Gemfile*
- humans.txt
- package.json
- robots.txt
- search-index*
- serve
- sitemap.xml
- system-security-plan.yml
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ markdown: RedcarpetExt
highlighter: rouge
redcarpet:
syntax_highlighter: rouge
extensions: ["tables", "quote"]
extensions: ["tables", "quote", "fenced_code_blocks"]

include:
- _navigation.json
Expand Down
23 changes: 22 additions & 1 deletion _data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ assigned:
text: Hire 18F
href: pages/hire.md
permalink: /hire/
collections: ['hire']
in_menu: true
in_drawer: true
in_footer: true
children:
-
text: 'Partnership playbook'
permalink: /hire/partnership-playbook/
collections: ['hire']
in_menu: false
in_drawer: false
in_footer: false
Expand All @@ -41,34 +43,39 @@ assigned:
-
text: '1. We build in the open'
permalink: /hire/partnership-playbook/we-build-in-the-open/
collections: ['hire']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: true
-
text: '2. How we work'
permalink: /hire/partnership-playbook/how-we-work/
collections: ['hire']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: true
-
text: '3. Who we work with'
permalink: /hire/partnership-playbook/who-we-work-with/
collections: ['hire']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: true
-
text: '4. Getting started'
permalink: /hire/partnership-playbook/getting-started/
collections: ['hire']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: true
-
text: '5. What to expect'
permalink: /hire/partnership-playbook/what-to-expect/
collections: ['hire']
in_menu: false
in_drawer: false
in_footer: false
Expand All @@ -77,41 +84,47 @@ assigned:
text: Join 18F
href: pages/join.md
permalink: /join/
collections: ['join']
in_menu: true
in_drawer: true
in_footer: true
children:
-
text: 'So you want to join 18F?'
permalink: /join/so-you-want-to-join-18f/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: false
-
text: 'Who we are hiring'
permalink: /join/hiring/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: false
-
text: 'Who we are hiring'
permalink: /join/hiring/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: false
-
text: 'How to apply'
permalink: /join/how-to-apply/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: false
-
text: 'Interview process'
permalink: /join/interview-process/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
Expand All @@ -120,41 +133,47 @@ assigned:
-
text: 'Child 1'
permalink: /join/interview-process/child-1/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: false
-
text: 'Child 2'
permalink: /join/interview-process/child-2/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: false
-
text: 'Child 2'
permalink: /join/interview-process/child-2/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: false
-
text: Benefits
permalink: /join/benefits/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: true
-
text: 'Government pay grades explained'
permalink: /join/government-pay-grades-explained/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
in_subnav: true
-
text: 'Leave policies'
permalink: /join/leave-policies/
collections: ['join']
in_menu: false
in_drawer: false
in_footer: false
Expand All @@ -163,14 +182,16 @@ assigned:
text: Blog
href: blog/index.html
permalink: /blog/
permalink_alt: /tags/
collections: ['authors', 'posts']
in_menu: true
in_drawer: true
in_footer: true
children:
-
text: Projects
href: _data/projects.yml
permalink: /project/
collections: ['projects']
in_menu: false
in_drawer: false
in_footer: false
Expand Down
1 change: 0 additions & 1 deletion _includes/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
children=false
nav_items=nav_items
%}
<!-- nav_items: {{ nav_items }} -->
{%
include navigation/footer-desktop.html
children=false
Expand Down
4 changes: 2 additions & 2 deletions _includes/navigation/drawer.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{% if item.children and has_enabled_children %}
{% if include.children %}
{% assign item_slug = item.text | slugify %}
{% assign is_matching = page.url | matches_url_parent: item.permalink %}
{% assign is_matching = page | matches_url_parent: item %}

<button class="usa-accordion-button{% if is_matching %} usa-current{% endif %}"
aria-expanded="false"
Expand Down Expand Up @@ -49,7 +49,7 @@
</ul>
{% endif %}
{% else %}
{% assign is_matching = page.url | matches_url_parent: item.permalink %}
{% assign is_matching = page | matches_url_parent: item %}

<a href="{{ item_link }}" {% if is_matching %}class="usa-current"{% endif %}>{{ item.text }}</a>
{% endif %}
Expand Down
3 changes: 2 additions & 1 deletion _includes/navigation/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
{% else %}
{% assign item_link = item.text | dasherize | hash_link | prepend: site.baseurl %}
{% endif %}
{% assign is_matching = page.url | matches_url_parent: item.permalink %}

{% assign is_matching = page | matches_url_parent: item %}

<a href="{{ item_link }}" {% if is_matching %}class="usa-current"{% endif %}><span>{{ item.text }}</span></a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion _includes/navigation/subnav.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h4>{{ include.page_data.text }}</h4>
{% if item.children and has_enabled_children %}
{% if include.children %}
{% assign item_slug = item.text | slugify %}
{% assign is_matching = page.url | matches_url_parent: item.permalink %}
{% assign is_matching = page | matches_url_parent: item %}

<button class="usa-accordion-button{% if is_matching %} usa-current{% endif %}"
aria-expanded="true"
Expand Down
1 change: 0 additions & 1 deletion _includes/tag-results.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% assign posts = include.posts | default: site.posts %}
{% assign tags = include.tags | default: post.tags | default: site.tags %}

<div class="blog-content" itemprop="blogPosts" itemscope itemtype="http://schema.org/BlogPosting">
<ul class="post-list{% if include.trim_padding %} post-list-no-padding{% endif %}">
Expand Down
30 changes: 0 additions & 30 deletions _navigation.json

This file was deleted.

17 changes: 2 additions & 15 deletions _plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,9 @@ Example:
> true
```

#### matches_url_parent: determines if the current page url (`page_url`) is a path decendent of a given `url`. Lives in [utility.md](utility.md).
#### matches_url_parent: determines if the current page url is a path decendent of a given url. Lives in [utility.md](utility.md).

Example:
```bash
{{ '/hire/' | matches_url_parent: '/hire/partnership-playbook/' }}
> true

{{ '/hire/partnership-playbook/' | matches_url_parent: '/hire/partnership-playbook/' }}
> true

{{ '/hire/partnership-playbook/' | matches_url: '/hire/' }}
> nil

{{ '/join/' | matches_url_parent: '/hire/partnership-playbook/' }}
> nil
```
Accepts two arguments, `page`, the current page that is being evaluated, and `item`, the navigation item that is being checked (from `navigation.yml`). If a collection is specified in the navigation item, it will first check if the item collection and page collection match.

#### find_page: looks at the list of navigation fields in [navigation.yml](navigation.yml) and find the object that corresponds with a given url. Lives in [utility.md](utility.md).

Expand Down
9 changes: 9 additions & 0 deletions _plugins/redcarpet.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
require 'redcarpet'
require 'rouge'
require 'rouge/plugins/redcarpet'


# Create a custom renderer that extend Redcarpet to customize its behavior.
class RedcarpetExtender < Redcarpet::Render::HTML
include Rouge::Plugins::Redcarpet

def initialize(options = {})
options ||= {}
redcarpet_extensions = Jekyll.configuration({})['redcarpet']['extensions']
Expand All @@ -23,6 +28,10 @@ def strip_dashes(str)
end
end

def block_code(code, language)
Rouge.highlight(code, language || 'text', 'html')
end

def header(title, level)
@headers = SiteHeaders.current
id_name = title.downcase.gsub(/[^a-z\0-9\s]/, '').gsub(/\W+/, '-')
Expand Down
Loading

0 comments on commit b861459

Please sign in to comment.