Skip to content

Commit bba04ae

Browse files
committed
docs: format page reform
The `/format/upcoming/` url still exists (in case it’s ever necessary to reference “the next version, whatever that may be at the time the link is followed”). However, it now simply redirects to `/format/1.1/` rather than having its own content. It’s status content previously was a bit confusing, and there wasn’t much reason for it to be a dedicated page. Additionally, it was confusing to have two links to v1.1 in the version picker (the upcoming link and the 1.1 permalink). So, now, the version picker excludes a separate permalink entry for v1.1, and instead has the picker entry for the “Upcoming spec” simply go to the `/format/1.1/` page.
1 parent 1e70d71 commit bba04ae

File tree

5 files changed

+23
-42
lines changed

5 files changed

+23
-42
lines changed

_format/1.1/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
---
22
version: 1.1
3+
status: rc
4+
release_date: 2019-01-31
35
---
46

57
## <a href="#introduction" id="introduction" class="headerlink"></a> Introduction

_format/upcoming/index.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
---
2-
is_upcoming_version: true
3-
status: rc
4-
release_date: 2019-01-31
2+
# Note: We have to do a `redirect_to` here rather than a redirect_from
3+
# in the file for the latest spec version, as the latter causes jekyll
4+
# generate a redirect to `/format/{version}/index.html`, which is an ugly
5+
# and non-canonical url, and jekyll's url config settings aren't flexible
6+
# enough to prevent this.
7+
redirect_to: /format/1.1/
58
---
6-
{% for spec_draft in site.format %}
7-
{% if spec_draft.version > site.latest_version and spec_draft.path contains 'index' %}
8-
{% comment %}
9-
The line below must be outdented (ugly as that is) or it will be parsed
10-
differently, since indentation can be significant in markdown (e.g. to
11-
indicate code blocks).
12-
{% endcomment %}
13-
14-
{{ spec_draft.content }}
15-
16-
{% endif %}
17-
{% endfor %}

_includes/status.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
{% assign version = include.version %}
77
{% assign is_latest_version_page = include.is_latest_version %}
8-
{% assign is_upcoming_version_page = include.is_upcoming_version %}
98
{% assign status = include.status %}
109

1110
## <a href="#status" id="status" class="headerlink"></a> Status
@@ -24,26 +23,20 @@
2423
always be backwards compatible** using a _never remove, only add_ strategy.
2524
Additions can be proposed in our [discussion forum](http://discuss.jsonapi.org/).
2625

27-
{% elsif is_upcoming_version_page %}
28-
This page presents the **{% if status == "rc" %}release candidate{% else %}
29-
working draft{% endif %}** for the next version of JSON:API, which is
30-
expected to be {{ site.latest_version|plus:0.1 }}. {% if status != "rc" %}
31-
As a draft, the content on this page is subject to change.{% else %}As a
32-
release candidate, the content on this page is unlikely to change. However,
33-
some changes may still occur if implementation experience proves that they are
34-
necessary before this version is finalized.{% endif %}
26+
{% elsif version and version > site.latest_version %}
27+
This page will always present the most recent text for JSON:API v{{ site.latest_version|plus:0.1 }}.
28+
Version {{ site.latest_version|plus:0.1 }} is a **{% if status == "rc" %}release
29+
candidate{% else %}working draft{% endif %}**. As such, the content on this
30+
page {% if status != "rc" %}is subject to change.{% else %}is unlikely to
31+
change. However, some changes may still occur if implementation experience
32+
proves that they are necessary before this version is finalized.{% endif %}
3533

3634
{% if include.release_date %}
37-
This version is expected to be finalized and released on
38-
**{{ include.release_date | date: "%B %e, %Y" }}** (provided there are two compliant implementations by that date; if not the release will wait until such implementations exist to prove its viability).
35+
This version is expected to be finalized and released on **{{ include.release_date | date: "%B %e, %Y" }}**
36+
(provided there are two compliant implementations by that date; if not the
37+
release will wait until such implementations exist to prove its viability).
3938
{% endif %}
4039

41-
42-
{% elsif version and version > site.latest_version %}
43-
This page will always present the most recent text for JSON:API
44-
v{{ site.latest_version|plus:0.1 }}. Version {{ site.latest_version|plus:0.1 }}
45-
has not been finalized, so the text here may change.
46-
4740
{% elsif version and version == site.latest_version %}
4841
This page presents an archived copy of JSON:API version {{ version }}. None
4942
of the normative text on this page will change. **Subsequent versions of
@@ -55,7 +48,6 @@
5548
of the normative text on this page will change. While {{ version }} is no
5649
longer the [latest version](/format/) of JSON:API, **new versions will remain
5750
compatible with this one**, as JSON:API uses a _never remove, only add_ strategy.
58-
5951
{% endif %}
6052

6153
{% comment %}

_includes/title_for_version.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@
1313
{% endcomment %}
1414
{% assign version = include.version %}
1515
{% assign is_latest_version_page = include.is_latest_version %}
16-
{% assign is_upcoming_version_page = include.is_upcoming_version %}
1716

1817
{% if is_latest_version_page %}
1918
Latest Specification (v{{ site.latest_version }})
2019

21-
{% elsif is_upcoming_version_page %}
22-
Draft for Next Specification Release
23-
2420
{% elsif version and version > site.latest_version %}
2521
Specification v{{site.latest_version|plus:0.1}} (Still in Development)
2622

_layouts/page.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
{% if page.is_spec_page %}
1515
{% capture page_title %}
16-
{% include title_for_version.md is_latest_version=page.is_latest_version is_upcoming_version=page.is_upcoming_version version=page.version %}
16+
{% include title_for_version.md is_latest_version=page.is_latest_version version=page.version %}
1717
{% endcapture %}
1818
{% else %}
1919
{% assign page_title = page.title %}
@@ -53,15 +53,15 @@ <h2>A specification for building APIs in JSON</h2>
5353
Latest Version (v{{ site.latest_version }})
5454
</option>
5555
<option
56-
value="/format/upcoming/"
57-
{% if page.is_upcoming_version %}selected{% endif %}
56+
value="/format/{{ site.latest_version|plus:0.1 }}/"
57+
{% if page.version > site.latest_version %}selected{% endif %}
5858
>
5959
Upcoming Version (v{{ site.latest_version|plus:0.1 }})
6060
</option>
6161
<optgroup label="Old Versions/Permalinks">
6262
{% assign sorted_formats = site.format|sort:'version' %}
6363
{% for spec_draft in sorted_formats %}
64-
{% if spec_draft.version and spec_draft.path contains 'index' %}
64+
{% if spec_draft.version <= site.latest_version and spec_draft.path contains 'index' %}
6565
<option value="/format/{{spec_draft.version}}"
6666
{% if page.version == spec_draft.version %}selected{% endif%}
6767
>
@@ -87,7 +87,7 @@ <h1>
8787
<section>
8888
{% if page.is_spec_page %}
8989
{% capture status %}
90-
{% include status.md release_date=page.release_date status=page.status version=page.version is_latest_version=page.is_latest_version is_upcoming_version=page.is_upcoming_version %}
90+
{% include status.md release_date=page.release_date status=page.status version=page.version is_latest_version=page.is_latest_version %}
9191
{% endcapture %}
9292
{{ status|strip|markdownify }}
9393
{% endif %}

0 commit comments

Comments
 (0)
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