Skip to content

Commit

Permalink
Merge pull request #7 from shawnjohnson/gh-pages
Browse files Browse the repository at this point in the history
Address a few issues to make customizing the template easier
  • Loading branch information
gbinal committed Aug 21, 2014
2 parents d33afc0 + 66e2fde commit 9403910
Show file tree
Hide file tree
Showing 19 changed files with 444 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.3-p392
ruby-2.1.1
1 change: 1 addition & 0 deletions .ruby-version.08.08.2014-19:54:37
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.9.3-p392
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,11 @@ If you are going to work on the JavaScript for this site, you need to do the fol

After changing the JavaScript, run `grunt` to rebuild the minified JS.

## Project Page URL Structure
In order to have the local resources work for both a github pages organizational and a project type site, pass a baseurl parameter at jekyll startup.

```
bundle exec jekyll server --watch --baseurl ''
```

[See this page for more information](http://jekyllrb.com/docs/github-pages/#project-page-url-structure)
16 changes: 14 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
name: Developer Hub
markdown: maruku
pygments: true
markdown: kramdown
highlighter: pygments
safe: true
baseurl: /
exclude: ['.ruby-version', 'node_modules', 'package.json', 'bower.json']
sass:
sass_dir: static/_sass

defaults:
-
scope:
path: "" # an empty string here means all files in the project
values:
organization-name: "Agency"
organization-url: "http://agency.gov"
organization-email: [email protected]
source-code-policy.url:
15 changes: 6 additions & 9 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<section class="footer-oss">
<h4>Open source</h4>
<p>
As a work of the United States Government, source code released by the [Agency] is in the public
As a work of the United States Government, source code released by the {{ page.organization-name }} is in the public
domain by default within the United States.
<a href="URLofRepo">
<a href="{{ page.source-code-policy }}">
View our full source code policy.
</a>
</p>
Expand All @@ -14,16 +14,13 @@ <h4>Open source</h4>
<section class="footer-links">
<ul>
<li>
<a href="http://www.agency.gov/">[agency].gov</a>
<a href="{{ page.organization-url }}">{{ page.organization-url }}</a>
</li>
<li>
<a href="http://github.com/agency">github.com/[agency]</a>
<a href="{{ site.github.owner_url }}">github.com/{{ site.github.owner_name }}</a>
</li>
<li>
<a href="mailto:">Contact us</a>
<a href="mailto:{{ page.organization-email }}">Contact us</a>
</li>
</ul>
</section>



</section>
5 changes: 2 additions & 3 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<div class="wrap">

<a href="http://agency.github.io/" target="_blank"><h1><span>[Agency]</span> Open Tech</h1></a>
<h1><a href="{{ site.github.url }}" target="_blank"><span>{{ page.organization-name }}</span> Open Tech</a></h1>

<a href="http://www.agency.gov/" target="_blank">
<img class="logo" src="http://usg-website-templates.github.io/developer-hub/static/img/logo_211.png" alt="Agency logo">
<img class="logo" src="{{ site.baseurl }}/static/img/logo.png" alt="{{ page.organization-name }} logo">
</a>

</a>
</div>
16 changes: 8 additions & 8 deletions _includes/nav.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

<h1 class="page-title"><a href="index.html">Agency <br>API docs</a></h1>
<p class="intro">Build your own tools using our API to access [Agency] public data.</p>
<h1 class="page-title"><a href="{{ site.baseurl }}/index.html">{{ page.organization-name }} <br>API docs</a></h1>
<p class="intro">Build your own tools using our API to access {{ page.organization-name }} public data.</p>
<nav>
<ul>
<li><a href="index.html" class="overview">Overview</a></li>
<li><a href="basics.html" class="basics">API basics</a></li>
<li><a href="console/" class="console">API calls</a></li>
<li><a href="queries.html" class="queries">Query language</a></li>
<li><a href="fields.html" class="fields">Field reference</a></li>
<li><a href="contribute.html" class="contribute">Contribute</a></li>
<li><a href="{{ site.baseurl }}/index.html" class="overview">Overview</a></li>
<li><a href="{{ site.baseurl }}/basics.html" class="basics">API basics</a></li>
<li><a href="{{ site.baseurl }}/console/" class="console">API calls</a></li>
<li><a href="{{ site.baseurl }}/queries.html" class="queries">Query language</a></li>
<li><a href="{{ site.baseurl }}/fields.html" class="fields">Field reference</a></li>
<li><a href="{{ site.baseurl }}/contribute.html" class="contribute">Contribute</a></li>
</ul>
</nav>
10 changes: 5 additions & 5 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>API documentation - [Agency] Open Tech</title>
<link rel="stylesheet" href="http://usg-website-templates.github.io/developer-hub/static/css/normalize.css">
<link rel="stylesheet" href="http://usg-website-templates.github.io/developer-hub/static/css/style.css">
<link rel="stylesheet" href="static/css/normalize.css">
<link rel="stylesheet" href="static/css/style.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!--[if IE]>
<link rel="stylesheet" href="http://usg-website-templates.github.io/developer-hub/static/css/for-ie-only.css">
<link rel="stylesheet" href="static/css/for-ie-only.css">
<![endif]-->
</head>
<body>
Expand Down Expand Up @@ -42,7 +42,7 @@
{% include footer.html %}
</div>
</footer>
<script src="http://usg-website-templates.github.io/developer-hub/static/js/docs.min.js"></script>
<script type="text/javascript" src="http://usg-website-templates.github.io/developer-hub/static/js/expandables.js"></script>
<script src="static/js/docs.min.js"></script>
<script type="text/javascript" src="static/js/expandables.js"></script>
</body>
</html>
17 changes: 17 additions & 0 deletions api-docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"apiVersion": "1.0",
"swaggerVersion": "1.2",
"basePath": "http://localhost:4000",
"apis":
[
{
"path": "/data.json",
"description": "Operations about datasets"
},

{
"path": "/hmda.json",
"description": "Operations about LAR data"
}
]
}
72 changes: 14 additions & 58 deletions console/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
---
title: Interactive API Console
---
<!DOCTYPE html>
<html>
<head>
<title>HMDA API documentation - CFPB Open Tech</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" href="css/normalize.css">
<link href="{{ site.baseurl }}/static/css/normalize.css" rel="stylesheet" type="text/css">

<link href='css/highlight.default.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link rel="stylesheet" href="css/style.css">
<link href="css/highlight.default.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="css/screen.css" rel="stylesheet" type="text/css" media="screen" />
<link href="{{ site.baseurl }}/static/css/style.css" rel="stylesheet" type="text/css"/>

<meta name="viewport" content="width=device-width, initial-scale=1">

Expand All @@ -35,7 +38,7 @@
<script type="text/javascript">
$(function () {
window.swaggerUi = new SwaggerUi({
url: "https://api.consumerfinance.gov/api-docs",
url: "{{ site.baseurl }}/api-docs.json",
dom_id: "swagger-ui-container",
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
onComplete: function(swaggerApi, swaggerUi){
Expand Down Expand Up @@ -79,39 +82,19 @@
})(window,document,'script','dataLayer','GTM-MVLMCF');</script>
<!-- End Google Tag Manager -->
<header class="header cf" role="banner">
<div class="wrap">
<a href="http://www.consumerfinance.gov/" target="_blank">
<img class="logo" src="img/logo_210.png" alt="Consumer Financial Protection Bureau logo">
</a>

<a href="http://cfpb.github.io/" target="_blank">
<h1><span>CFPB</span> Open Tech</h1>
</a>
</div>

{% include header.html %}
</header>

<div class="wrap">
<div class="content">

<aside>
<h1 class="page-title"><a href="../index.html">HMDA <br>API docs</a></h1>
<p class="intro">Build your own tools using our API to access HMDA public data.</p>
<nav>
<ul>
<li><a href="../index.html" class="overview">Overview</a></li>
<li><a href="../basics.html" class="basics">API basics</a></li>
<li><a href="../console/" class="console">API calls</a></li>
<li><a href="../queries.html" class="queries">Query language</a></li>
<li><a href="../fields.html" class="fields">Field reference</a></li>
<li><a href="../contribute.html" class="contribute">Contribute</a></li>
</ul>
</nav>
{% include nav.html %}
</aside>

<section class="main-content" role="main">

<h3 id='api_calls'>API calls</h3>
<h3 id='api_calls'>{{ page.title }}</h3>

<p>Explore the API here hands-on. Need a little help? Read our <a href="../basics.html">API basics</a> to learn about
datasets, concepts, and slices.
Expand All @@ -134,37 +117,10 @@ <h5 id='ready_to_dive_deeper'>Ready to dive deeper?</h5>

<footer class="footer cf" role="contentinfo">
<div class="wrap">

<section class="footer-oss">
<h4>Open source</h4>
<p>
As a work of the United States Government, source code released by the CFPB is in the public
domain by default within the United States.
<a href="https://github.com/cfpb/source-code-policy/blob/master/cfpb-source-code-policy.txt">
View our full source code policy.
</a>
</p>
</section>
<section class="footer-links">
<ul>
<li>
<a href="http://www.consumerfinance.gov/">consumerfinance.gov</a>
</li>
<li>
<a href="http://github.com/cfpb">github.com/cfpb</a>
</li>
<li>
<a href="http://www.consumerfinance.gov/jobs/">Work with us</a>
</li>
<li>
<a href="mailto:[email protected]">Contact us</a>
</li>
</ul>
</section>

{% include footer.html %}
</div>
</footer>
<script src="../static/js/docs.min.js"></script>
<script type="text/javascript" src="../static/js/expandables.js"></script>
<script src="{{ site.baseurl }}/static/js/docs.min.js"></script>
<script type="text/javascript" src="{{ site.baseurl }}/static/js/expandables.js"></script>
</body>
</html>
78 changes: 78 additions & 0 deletions data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"basePath": "https://api.consumerfinance.gov:443",
"apiVersion": "1.0",
"swaggerVersion": "1.2",
"resourcePath": "/data",
"produces":
[
"application/json",
"application/xml"
],

"models":
{

},

"apis":
[
{
"path": "/data",
"operations":
[
{
"method": "GET",
"produces":
[
"application/json",
"application/xml"
],

"nickname": "getDatasets",
"summary": "Get a list of all datasets.",
"parameters":
[

]
}
]
},

{
"path": "/data/{dataset}",
"operations":
[
{
"method": "GET",
"produces":
[
"application/json",
"application/xml"
],

"nickname": "getDataset",
"summary": "Get metadata about a dataset.",
"parameters":
[
{
"required": true,
"allowableValues":
{
"valueType": "LIST",
"values":
[
"hmda"
]
},

"paramType": "path",
"description": "Name of dataset",
"dataType": "string",
"name": "dataset"
}
]
}
]
}
]
}
Loading

0 comments on commit 9403910

Please sign in to comment.