Skip to content

Design refresh #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
May 19, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ef7f55d
Implemented basics of new design
wvteijlingen Mar 27, 2015
c288a31
Changed h3s to h2s on FAQ page
wvteijlingen Mar 27, 2015
fd5e53f
Sidebar affix, CSS vendor prefixes
wvteijlingen Mar 29, 2015
74b91cb
Removed fixed width from quicklinks
wvteijlingen Mar 30, 2015
edc1de7
Rename quicklinks and examples
wvteijlingen Mar 30, 2015
836c132
Improved responsiveness
wvteijlingen Mar 30, 2015
5c9087e
Removed old styling for code blocks
wvteijlingen Mar 30, 2015
10d37b1
Added social links to footer
wvteijlingen Mar 30, 2015
cdd70a8
Changed typography to Helvetica Neue
wvteijlingen Mar 30, 2015
5c22119
Improved responsiveness of header
wvteijlingen Mar 30, 2015
d1be980
Fixed respsonsive bug with logo
wvteijlingen Mar 30, 2015
fd1a549
Updated quicklinks margin
wvteijlingen Mar 30, 2015
0d69f80
Removed separate header and footer includes.
wvteijlingen Mar 30, 2015
21f9808
Moved Javascript to all.js
wvteijlingen Mar 30, 2015
78588b0
Removed code collapsing from Javascript.
wvteijlingen Mar 30, 2015
00273f2
Added a check to prevent creation of document outline when no sidebar…
wvteijlingen Mar 30, 2015
617abd7
Removed trailing dot from index page title.
wvteijlingen Mar 30, 2015
dfcb62d
Remove redundant table of contents
dgeb May 19, 2015
b830cbc
Show page title unless showing masthead.
dgeb May 19, 2015
9578f41
Show sidebar for Extensions, Implementations, and Recommendations.
dgeb May 19, 2015
b0ad081
Remove redundant title declaration.
dgeb May 19, 2015
c01a940
Sidebar and H1 styling tweaks.
dgeb May 19, 2015
18db614
Rework masthead and logo.
dgeb May 19, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Implemented basics of new design
  • Loading branch information
wvteijlingen authored and dgeb committed May 19, 2015
commit ef7f55d955cf09226b0afd48146104cda0c097db
8 changes: 8 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pygments: false
port: 9876

navigation:
- title: JSON:API
url: /
- title: Format
url: /format/
- title: Extensions
Expand All @@ -29,3 +31,9 @@ navigation:
url: /faq/
- title: About
url: /about/

quicklinks:
- title: Documentation
url: /format/
- title: Github
url: https://github.com/json-api/json-api
49 changes: 35 additions & 14 deletions _layouts/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,52 @@
<!-- Use title if it's in the page YAML frontmatter -->
<title>JSON API :: {{ page..title }}</title>

<link href='http://fonts.googleapis.com/css?family=Titillium+Web:400,600,700,900' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Titillium+Web:400,300,600' rel='stylesheet' type='text/css'>
<link href="/stylesheets/normalize.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/stylesheets/highlight.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/stylesheets/all.css" media="screen" rel="stylesheet" type="text/css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="/javascripts/all.js" type="text/javascript"></script>
<script src="/javascripts/highlight.pack.js"></script>
<script src="/javascripts/sidebar-nav.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</head>

<body>
{% include header.html %}
<article>

<section>
{% if page.show_masthead %}
<div class="masthead">
<img src="/images/jsonapi@1.3x.png">
<h1>{{ page.title }}</h1>
<nav class="site-nav">
<ul>
{% assign url = page.url|remove:'index.html' %}
{% for link in site.navigation %}
<li {% if url == link.url %}class="active"{% endif %}><a href="{{link.url}}" title="{{link.title}}">{{link.title}}</a></li>
{% endfor %}
</ul>
</nav>
{% if page.show_masthead %}
<header>
<div class="content">
<h1>JSON:API</h1>
<div class="quicklinks">
{% for link in site.quicklinks %}
<a href="{{link.url}}">{{link.title}}</a>
{% endfor %}
</div>
</div>
{% else %}
<h1>{{ page.title }}</h1>
{% endif %}
</header>
{% endif %}
<div class="site-wrapper">
{% if page.show_sidebar %}
<nav class="site-content-nav" id="document-outline">
<h2>{{ page.title }}</h2>
</nav>
{% endif %}
<section class="site-content">
{{ content }}
</section>
</article>
{% include footer.html %}
</div>
<footer>
<span>Built with <a href="http://jekyllrb.com/">Jekyll</a> and <a href="http://softwaremaniacs.org/soft/highlight/en/">Highlight.js</a></span>
<span>Hosted by <a href="http://pages.github.com/">GitHub Pages</a></span>
<span>Generated at {{ site.time | date_to_xmlschema }}</span>
</footer>
</body>
</html>
1 change: 1 addition & 0 deletions format/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
layout: page
title: "Format"
show_sidebar: true
---

{% include status.md %}
Expand Down
27 changes: 27 additions & 0 deletions images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 74 additions & 0 deletions javascripts/sidebar-nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
$(document).ready(function() {
var articleOutline = createOutlineFromArticle($('.site-content').eq(0));
var navList = createArticleNavigationFromOutline(articleOutline);
$("#document-outline").append(navList);

$("#document-outline li").click(function(event) {
$("#document-outline li").removeClass('active');
$(this).toggleClass('active');
})
});

/**
* Returns an array in the form of:
* [{
* title: "Title",
* href: "#anchor",
* children: [...]
* }, {
* title: "Title",
* href: "#anchor",
* children: [...]
* }];
*/
function createOutlineFromArticle(article) {
var outline = [];

$('h2', article).each(function() {
var item = {
title: $(this).not('a').text(),
href: $(this).find('a').attr('href') || "#",
children: []
};

$(this).nextUntil('h2', 'h3').each(function() {
var childItem = {
title: $(this).not('a').text(),
href: $(this).find('a').attr('href') || "#",
children: []
};

item.children.push(childItem);
});

outline.push(item);
});

return outline;
}

/**
* Creates a nested list from an array in the form returned by `createOutlineFromArticle`.
*/
function createArticleNavigationFromOutline(outline) {
function createListFromItems(items) {
var ol = document.createElement('ol');
ol.class = "nav"

items.forEach(function(item) {
var a = document.createElement('a');
a.href = item.href;
a.appendChild(document.createTextNode(item.title));

var li = document.createElement('li');
li.appendChild(a);
li.appendChild(createListFromItems(item.children));

ol.appendChild(li);
});

return ol;
}

return createListFromItems(outline);
}
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy