Skip to content
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

gh-pages: specification version lists on landing page #4013

Merged
merged 13 commits into from
Aug 15, 2024
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@ This site contains the OpenAPI Initiative Registry and content for the HTML vers

## Registry

* Proceed to [Registry](./registry/index.html)
* Proceed to [Registry](https://spec.openapis.org/registry/index.html)

## OpenAPI Initiative Specifications

| Specification | Markdown Repository | HTML Version |
| Specification | Markdown Repository | Versions |
| :--------------| :------------------ | :------- |
| `OpenAPI Specification` | [View](https://github.com/OAI/OpenAPI-Specification)|[**Latest (3.1.0)**](oas/latest.html), [3.0.3](https://spec.openapis.org/oas/v3.0.3.html), [3.0.2](https://spec.openapis.org/oas/v3.0.2.html), [3.0.1](https://spec.openapis.org/oas/v3.0.1.html), [**3.0.0**](https://spec.openapis.org/oas/v3.0.0.html), [**2.0**](https://spec.openapis.org/oas/v2.0.html)|
| `Arazzo Specification` | [View](https://github.com/OAI/Arazzo-Specification) | [1.0.0](https://spec.openapis.org/arazzo/v1.0.0.html)|
| OpenAPI Specification | [View](https://github.com/OAI/OpenAPI-Specification)|[**3.1.0**](https://spec.openapis.org/oas/v3.1.0.html)<br> [**3.0.3**](https://spec.openapis.org/oas/v3.0.3.html), [3.0.2](https://spec.openapis.org/oas/v3.0.2.html), [3.0.1](https://spec.openapis.org/oas/v3.0.1.html), [3.0.0](https://spec.openapis.org/oas/v3.0.0.html)<br> [**2.0**](https://spec.openapis.org/oas/v2.0.html) |
| Arazzo Specification | [View](https://github.com/OAI/Arazzo-Specification) | [1.0.0](https://spec.openapis.org/arazzo/v1.0.0.html) |

## Development

Install [jekyll](https://jekyllrb.com/docs/installation/) for your platform, install the site
~~~sh
bundle install
~~~
run it
~~~sh
bundle exec jekyll serve --livereload
~~~
and change it to your heart's content :sunglasses:
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ color_scheme: oai
title: OpenAPI Initiative Registry
description: Extensible data value repository
show_downloads: true
excerpt_separator: ""
collections_dir: /registries
collections:
posts:
Expand Down
15 changes: 15 additions & 0 deletions _includes/specification-version-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% assign html_files = site.static_files | where: "extname", ".html" | sort: "basename" | reverse %}
{% assign last_version = "" %}
{%- for file in html_files -%}
{%- assign segments = file.path | split: "/" -%}
{%- assign firstchar = file.basename | slice: 0 -%}
{%- if segments[1] == include.specification and firstchar == "v" -%}
{%- assign minor_version = file.basename | slice: 1, 3 -%}
{%- if minor_version != last_version -%}
{% assign last_version = minor_version %}
* **[{{ file.basename }}]({{ site.baseurl }}{{ file.path }})**
{%- else -%}
, [{{ file.basename }}]({{ site.baseurl }}{{ file.path }})
{%- endif -%}
{%- endif -%}
{%- endfor- %}
32 changes: 27 additions & 5 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,31 @@ This site contains the OpenAPI Initiative Registry and content for the HTML vers

* Proceed to [Registry](./registry/index.html)

## OpenAPI Initiative Specifications
## Arazzo Specification

| Specification | Markdown Repository | HTML Version |
| :--------------| :------------------ | :------- |
| `OpenAPI Specification` | [View](https://github.com/OAI/OpenAPI-Specification)|[View](oas/latest.html)|
| `Arazzo Specification` | [View](https://github.com/OAI/Arazzo-Specification) | [View](arazzo/latest.html)|
### Versions

{% include specification-version-list.md specification="arazzo" %}

## OpenAPI Specification

### Versions

{% include specification-version-list.md specification="oas" %}

### Non-Normative JSON Schemas

{% assign schema_files = site.static_files | where: "extname", "" | sort: "path" | reverse %}
{% assign last_version = "" %}
{%- for file in schema_files -%}
{%- assign segments = file.path | split: "/" -%}
{%- if segments[1] == "oas" and file.basename contains "lat" -%}
{%- if segments[2] != last_version -%}
{%- assign last_version = segments[2] %}
* **v{{ last_version }}**
{%- assign separator = ": " -%}
{%- endif -%}
{{ separator }}[{{ segments[3] }}]({{ file.path }})
{%- assign separator = ", " -%}
{%- endif -%}
{%- endfor -%}
24 changes: 13 additions & 11 deletions rss/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ layout: none
<link>{{ site.url }}{{ site.baseurl }}/</link>
<atom:link href="{{ "/rss/feed.xml" | prepend: site.baseurl | prepend: site.url }}" rel="self" type="application/rss+xml" />
{% for reg in site.collections %}
{% assign name = reg.label %}
{% for value in site.[name] %}
<item>
<title>{{ value.slug | xml_escape }}</title>
<description>{{ value.description | xml_escape }}</description>
<category>{{ reg.label }}</category>
<pubDate>{% if value.date %}{{ value.date | date: "%a, %d %b %Y %H:%M:%S %z" }}{% else %}{{ 'now' | date: "%a, %d %b %Y %H:%M:%S %z" }}{% endif %}</pubDate>
<link>{{ value.url }}</link>
<guid isPermaLink="true">{{ value.url }}</guid>
</item>
{% endfor %}
{% if reg.output %}
{% assign name = reg.label %}
{% for value in reg.docs %}
<item>
<title>{{ value.slug | xml_escape }}</title>
<description>{{ value.description | xml_escape }}</description>
<category>{{ reg.label }}</category>
<pubDate>{% if value.date %}{{ value.date | date: "%a, %d %b %Y %H:%M:%S %z" }}{% else %}{{ 'now' | date: "%a, %d %b %Y %H:%M:%S %z" }}{% endif %}</pubDate>
<link>{{ value.url }}</link>
<guid isPermaLink="true">{{ value.url }}</guid>
</item>
{% endfor %}
{% endif %}
{% endfor %}
</channel>
</rss>