Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 30 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ whitelist:
- jekyll-sitemap
- jekyll-feed
- jekyll-seo-tag
- jekyll-gist
- jemoji
incremental: false
gist:
noscript: false

# customize github pages
quiet: false
markdown: kramdown
highlighter: rouge
kramdown:
input: GFM
hard_wrap: false
auto_ids: false
auto_ids: true
auto_id_prefix: auto-id-
auto_id_stripping: true
template: '' # cannot customize
math_engine: mathjax # cannot customize
syntax_highligher: rouge # cannot customize
Expand All @@ -48,6 +50,9 @@ port: 9876
collections:
format:
output: true
profiles:
output: true
permalink: /:collection/:path

defaults:
- scope:
Expand All @@ -57,6 +62,20 @@ defaults:
layout: page
show_sidebar: true
is_spec_page: true
- scope:
path: ""
type: "profiles"
values:
layout: profile_error
is_spec_page: false
show_sidebar: false
- scope:
path: "*/*/*/index.md"
type: "profiles"
values:
layout: profile
is_spec_page: false
show_sidebar: true

latest_version: 1.0
excerpt_separator: ""
Expand Down Expand Up @@ -84,3 +103,12 @@ quicklinks:
url: /format/
- title: Contribute on GitHub
url: https://github.com/json-api/json-api

profile_categories:
- Pagination
# these are some other potential categories.
# Uncomment them if you're adding a profile in one of these categories.
# - Filtering
# - Actions/Hypermedia
# - Data Modeling
# - Deep Querying
17 changes: 11 additions & 6 deletions _format/1.1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ other and with `type` and `id`. In other words, a resource can not have an
attribute and relationship with the same name, nor can it have an attribute
or relationship named `type` or `id`.

#### <a href="#document-resource-object-attributes" id="document-resource-object-attributes" class="headerlink"></a> Attributes
##### <a href="#document-resource-object-attributes" id="document-resource-object-attributes" class="headerlink"></a> Attributes

The value of the `attributes` key **MUST** be an object (an "attributes
object"). Members of the attributes object ("attributes") represent information
Expand All @@ -253,7 +253,7 @@ alongside other information to be represented in a resource object, these keys

> Note: See [fields] and [member names] for more restrictions on this container.

#### <a href="#document-resource-object-relationships" id="document-resource-object-relationships" class="headerlink"></a> Relationships
##### <a href="#document-resource-object-relationships" id="document-resource-object-relationships" class="headerlink"></a> Relationships

The value of the `relationships` key **MUST** be an object (a "relationships
object"). Members of the relationships object ("relationships") represent
Expand Down Expand Up @@ -285,7 +285,7 @@ data, not the related resources.

> Note: See [fields] and [member names] for more restrictions on this container.

#### <a href="#document-resource-object-related-resource-links" id="document-resource-object-related-resource-links" class="headerlink"></a> Related Resource Links
##### <a href="#document-resource-object-related-resource-links" id="document-resource-object-related-resource-links" class="headerlink"></a> Related Resource Links

A "related resource link" provides access to [resource objects][resource objects] [linked][links]
in a [relationship][relationships]. When fetched, the related resource object(s)
Expand All @@ -300,7 +300,7 @@ relationship isn't currently associated with any target resources. Additionally,
a related resource link **MUST NOT** change because its relationship's content
changes.

#### <a href="#document-resource-object-linkage" id="document-resource-object-linkage" class="headerlink"></a> Resource Linkage
##### <a href="#document-resource-object-linkage" id="document-resource-object-linkage" class="headerlink"></a> Resource Linkage

Resource linkage in a [compound document] allows a client to link together all
of the included [resource objects] without having to `GET` any URLs via [links].
Expand Down Expand Up @@ -1920,10 +1920,10 @@ request is received, a server **SHOULD** attempt to apply the requested profiles
to its response.

For example, in the following request, the client asks that the server apply the
`http://jsonapi.org/extensions/last-modified` profile if it is able to.
`http://example.com/last-modified` profile if it is able to.

```http
Accept: application/vnd.api+json;profile="http://example.com/extensions/last-modified", application/vnd.api+json
Accept: application/vnd.api+json;profile="http://example.com/last-modified", application/vnd.api+json
```

> Note: The second instance of the JSON:API media type in the example above is
Expand Down Expand Up @@ -2252,6 +2252,11 @@ supported as well.
3. alter the JSON structure of any concept defined in this specification,
including to allow a superset of JSON structures.


> If you create your own profile, you are **strongly encouraged to [register](/extensions/#profile-registration)
> it** with the JSON API [profile registry](/extensions/), so that others can
> find and reuse it.

#### <a href="#profiles-updating" id="profiles-updating" class="headerlink"></a> Revising a Profile

Profiles **MAY** be revised over time, e.g., to add new capabilities. However,
Expand Down
32 changes: 32 additions & 0 deletions _includes/global_head_assets.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/stylesheets/normalize.css" rel="stylesheet" type="text/css" />
<link href="/stylesheets/all.css" rel="stylesheet" type="text/css" />
<link href="/stylesheets/print.css" media="print" 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>hljs.configure({classPrefix: ''}); hljs.initHighlightingOnLoad();</script>

<link rel="apple-touch-icon" sizes="57x57" href="/alt-favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/alt-favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/alt-favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/alt-favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/alt-favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/alt-favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/alt-favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/alt-favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/alt-favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="/alt-favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/alt-favicons/favicon-194x194.png" sizes="194x194">
<link rel="icon" type="image/png" href="/alt-favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/alt-favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="/alt-favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/alt-favicons/manifest.json">
<link rel="mask-icon" href="/alt-favicons/safari-pinned-tab.svg" color="#0b4e22">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="/alt-favicons/mstile-144x144.png">
<meta name="msapplication-config" content="/alt-favicons/browserconfig.xml">
<meta name="theme-color" content="#0b4e22">
23 changes: 23 additions & 0 deletions _includes/global_html_footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<footer>
<div class="site-wrapper">
<span>Built with <a href="https://jekyllrb.com/">Jekyll</a> and <a href="http://softwaremaniacs.org/soft/highlight/en/">Highlight.js</a></span>
<span class="license">
<a rel="license" href="https://creativecommons.org/publicdomain/zero/1.0/"><img src="https://licensebuttons.net/p/zero/1.0/88x31.png" style="border- style: none;" alt="CC0" /></a>
</span>
<span class="social-links">
<a class="twitter" href="https://twitter.com/jsonapi"><i class="icon-twitter"></i><span>Twitter</span></a>
<a class="github" href="https://github.com/json-api"><i class="icon-github"></i><span>GitHub</span></a>
<a class="forum" href="https://discuss.jsonapi.org"><i class="icon-forum"></i><span>Discussion Forum</span></a>
</span>
</div>
</footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-40609539-1', 'jsonapi.org');
ga('send', 'pageview');

</script>
33 changes: 33 additions & 0 deletions _includes/header_offset_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{% comment %}
When we embed the markdown from a user-provided profile specification
inside the profile layout, we need to increment each heading level by 2.
Kramdown, our markdown parser, provides a `header_offset` option, but
Jekyll only allows us to set that globally -- and setting it globally
to two would break our other pages. So, this include lets us take arbitrary
HTML (from rendered markdown) and does some liquid string replacements
to offset its headings. This is pretty janky (even more so because liquid
only allows us to do literal string replacement, not regex replacement),
but I think it *should* work robustly, thanks to the fact that angle
brackets (i.e., `<` and `>`) aren't supposed to appear in HTML unencoded,
and I imagine Kramdown respects that.
{% endcomment %}
{{ include.content
| replace: "<h5", "<h6x"
| replace: "<h4", "<h6x"
| replace: "<h3", "<h5x"
| replace: "<h2", "<h4x"
| replace: "<h1", "<h3x"
| replace: "</h1>", "</h3x>"
| replace: "</h2>", "</h4x>"
| replace: "</h3>", "</h5x>"
| replace: "</h4>", "</h6x>"
| replace: "</h5>", "</h6x>"
| replace: "<h3x", "<h3"
| replace: "<h4x", "<h4"
| replace: "<h5x", "<h5"
| replace: "<h6x", "<h6"
| replace: "</h3x>", "</h3>"
| replace: "</h4x>", "</h4>"
| replace: "</h5x>", "</h5>"
| replace: "</h6x>", "</h6>"
}}
5 changes: 5 additions & 0 deletions _includes/profile_url.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% comment %}
Takes the page object for a JSON:API profile spec and returns its url.
This file can't have whitespace outside this comment block or else the
output will be corrupted.
{% endcomment %}{{ include.page.url | absolute_url | split: "/" | where_exp: "item", "item != 'index'" | join: "/" }}/
13 changes: 13 additions & 0 deletions _includes/site_navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<nav class="site-nav">
<div class="nav-inner">
<ul>
{% assign url = page.url|remove:'index.html' %}
{% for link in site.navigation %}
<li {% if url == link.url or url contains "/profiles/" and link.url contains "/extensions" %}class="active"{% endif %}><a href="{{link.url}}" title="{{link.title}}">{{link.title}}</a></li>
{% endfor %}
<li class="version">
<a href="/format/#status" class="pill">v{{ site.latest_version }} <span class="stable">Stable</span></a>
</li>
</ul>
</div>
</nav>
83 changes: 9 additions & 74 deletions _layouts/page.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% include global_head_assets.html %}

{% comment %}
Below, we're either dealing with a generic page or a page from the
Expand All @@ -20,57 +18,15 @@
{% else %}
{% assign page_title = page.title %}
{% endif %}
<title>JSON:API &mdash; {{page_title|strip }}</title>

<link href="/stylesheets/normalize.css" rel="stylesheet" type="text/css" />
<link href="/stylesheets/all.css" rel="stylesheet" type="text/css" />
<link href="/stylesheets/print.css" media="print" 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>hljs.configure({classPrefix: ''}); hljs.initHighlightingOnLoad();</script>

<link rel="apple-touch-icon" sizes="57x57" href="/alt-favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/alt-favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/alt-favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/alt-favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/alt-favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/alt-favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/alt-favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/alt-favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/alt-favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="/alt-favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/alt-favicons/favicon-194x194.png" sizes="194x194">
<link rel="icon" type="image/png" href="/alt-favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/alt-favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="/alt-favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/alt-favicons/manifest.json">
<link rel="mask-icon" href="/alt-favicons/safari-pinned-tab.svg" color="#0b4e22">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-TileImage" content="/alt-favicons/mstile-144x144.png">
<meta name="msapplication-config" content="/alt-favicons/browserconfig.xml">
<meta name="theme-color" content="#0b4e22">
<title>JSON:API &mdash; {{ page_title|strip }}</title>
</head>

<body>
<nav class="site-nav">
<div class="nav-inner">
<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 %}
<li class="version">
<a href="/format/#status" class="pill">v{{ site.latest_version }} <span class="stable">Stable</span></a>
</li>
</ul>
</div>
</nav>
{% include site_navigation.html %}
{% if page.show_masthead %}
<header>
<div class="content">
<h1>JSON:API</h1>
<h1 id="json-api">JSON:API</h1>
<h2>A specification for building APIs in JSON</h2>
<div class="quicklinks">
{% for link in site.quicklinks %}
Expand Down Expand Up @@ -103,7 +59,8 @@ <h2>A specification for building APIs in JSON</h2>
Upcoming Version (v{{ site.latest_version|plus:0.1 }})
</option>
<optgroup label="Old Versions/Permalinks">
{% for spec_draft in site.format|sort:'version' %}
{% assign sorted_formats = site.format|sort:'version' %}
{% for spec_draft in sorted_formats %}
{% if spec_draft.version and spec_draft.path contains 'index' %}
<option value="/format/{{spec_draft.version}}"
{% if page.version == spec_draft.version %}selected{% endif%}
Expand All @@ -121,7 +78,7 @@ <h1 class="sidebar-top">{{ page_title }}</h1>
</nav>
</div>
{% endif %}
<div class="content">
<main class="content">
{% unless page.show_masthead %}
<h1>
{{ page_title }}
Expand All @@ -136,31 +93,9 @@ <h1>
{% endif %}
{{ content }}
</section>
</div>
</main>
</div>
<footer>
<div class="site-wrapper">
<span>Built with <a href="https://jekyllrb.com/">Jekyll</a> and <a href="http://softwaremaniacs.org/soft/highlight/en/">Highlight.js</a></span>
<span class="license">
<a rel="license" href="https://creativecommons.org/publicdomain/zero/1.0/"><img src="https://licensebuttons.net/p/zero/1.0/88x31.png" style="border- style: none;" alt="CC0" /></a>
</span>
<span class="social-links">
<a class="twitter" href="https://twitter.com/jsonapi"><i class="icon-twitter"></i><span>Twitter</span></a>
<a class="github" href="https://github.com/json-api"><i class="icon-github"></i><span>GitHub</span></a>
<a class="forum" href="https://discuss.jsonapi.org"><i class="icon-forum"></i><span>Discussion Forum</span></a>
</span>
</div>
</footer>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-40609539-1', 'jsonapi.org');
ga('send', 'pageview');

</script>
{% include global_html_footer.html %}
</body>

</html>
Loading