From 68990b4f322b386e72b393058232d98381deea07 Mon Sep 17 00:00:00 2001 From: Martina Lilja Date: Wed, 10 Apr 2024 13:16:43 +0200 Subject: [PATCH] Finish - ESY-6291 Updated look of Release notes to match Design guide examples --- _includes/alert.html | 3 +- _includes/doc-container.html | 20 +++++--- _includes/release_notes.html | 95 ++++++++++++++++++++++++++++-------- page1.md | 2 +- page2.md | 2 +- resources/release-notes.md | 6 +-- 6 files changed, 92 insertions(+), 36 deletions(-) diff --git a/_includes/alert.html b/_includes/alert.html index a7c08bf2e..7a5b14e3c 100644 --- a/_includes/alert.html +++ b/_includes/alert.html @@ -4,8 +4,7 @@ {% assign header = include.header | markdownify | remove: '

' | remove: '

' | strip %} {% assign body = include.body | markdownify | remove: '

' | remove: '

' | strip %} -
+
{% if icon != blank and icon != empty and icon != nil %} {{ icon }} {% endif %} diff --git a/_includes/doc-container.html b/_includes/doc-container.html index 51b70d6e0..311609cfc 100644 --- a/_includes/doc-container.html +++ b/_includes/doc-container.html @@ -1,19 +1,23 @@ {% capture max_width_class %} - {% if page.layout == 'front-page' %} - no-padding - {% elsif page.card_overview %} - normal-padding max-width-card-overview - {% else %} - normal-padding max-width - {% endif %} +{% if page.layout == 'front-page' %} +no-padding +{% elsif page.card_overview %} +normal-padding max-width-card-overview +{% elsif page.release_notes %} +dg-front-page py-0 +{% else %} +normal-padding max-width +{% endif %} {% endcapture %}
{% if page.card_overview %} {% include card-overview.html %} + {% elsif page.release_notes %} + {% include release_notes.html num_of_releases_to_display=5 release_notes_title="What's new in " %} {% else %} {% include anchor_headings.html html=content anchorClass='header-anchor' %} {% endif %}
-
+
\ No newline at end of file diff --git a/_includes/release_notes.html b/_includes/release_notes.html index bb640340f..cefdbad1d 100644 --- a/_includes/release_notes.html +++ b/_includes/release_notes.html @@ -1,30 +1,85 @@ -{% assign num_dates = include.num_dates %} -{% for page in site.pages %} -{% assign release_notes_url = '/resources/release-notes' %} -{% if page.url contains release_notes_url %} -
- {% assign dates = page.content | markdownify | split: ' - {% assign versions = date | split: ' - {% assign date_value = versions[0] | remove: '' | split: '>' %} - {{ date_value[1] | strip }} +{% assign num_of_releases_to_display = include.num_of_releases_to_display %} +{% assign release_notes_title = include.release_notes_title %} +{% if page.url contains '/release-notes' %} + {% for sitePage in site.pages %} + {% if sitePage.url == page.url %} + {% assign min_cnt = num_of_releases_to_display | plus: 1 %} + {% assign max_cnt = sitePage.content | split: '' | size %} + {% assign releases = sitePage.content | markdownify | split: ' +
+
+ + {{ release_notes_title | append: sitePage.lead_title }} +
+
+ {% include alert.html type="informative" icon="info" header="Version numbers" + body="The version numbers used in headers on this page refers to the version of + this very documentation, not to a version of any APIs described by it." %} +
+ {% for release in releases %} + {% if forloop.length > 0 %} + {% if forloop.last %} +
+ {% else %} +
+ {% endif %} + {% endif %} + {% assign versions = release | split: ' + {% assign release_value = versions[0] | remove: '' | split: '>' %} + {{ release_value[1] | strip }}
- {% assign version_list = versions | shift %} -
+ {% assign version_list = versions | shift %} +
{% for version in version_list %} {% assign version_parts = version | split: '' %} {% assign version_value = version_parts[0] | split: '>' %} {% assign version_id = version | regex_capture: 'id="([^"]+)"' | first %} -

{{ version_value[1] }}

- {{ version_parts[1] }} +

{{ version_value[1] }}

+

{{ version_parts[1] }}

{% endfor %}
+ {% endfor %} +
+ + {% if archive.size > 0 %} +
+
+ +
+
+ {% for archive_release in archive %} + {% assign archive_versions = archive_release | split: '' | split: '>' %} + {% assign archive_version_list = archive_versions | shift %} +
+
+ {{ archive_release_value[1] | strip }} +
+
+ {% for archive_version in archive_version_list %} + {% assign archive_version_parts = archive_version | split: '' %} + {% assign archive_version_value = archive_version_parts[0] | split: '>' %} + {% assign archive_version_id = archive_version | regex_capture: 'id="([^"]+)"' | first %} +

{{ archive_version_value[1] }}

+

{{ version_parts[1] }}

+ {% endfor %} +
+
+ {% endfor %} +
+
+
+
+ {% endif %} + + + {% endif %} + {% endfor %} -
{% endif %} -{% endfor %} diff --git a/page1.md b/page1.md index 33ac73d90..1ebc01796 100644 --- a/page1.md +++ b/page1.md @@ -126,7 +126,7 @@ sidebar_icon: filter_1 {% contentfor release_notes %}

What's new in the documentation

- {% include release_notes.html num_dates=3 %} + {% include release_notes.html num_of_releases_to_display=3 release_notes_title="What's new in " %} See full release notes {% endcontentfor %} diff --git a/page2.md b/page2.md index e8f2a98ee..f58817f15 100644 --- a/page2.md +++ b/page2.md @@ -42,7 +42,7 @@ sidebar_icon: filter_2 {% contentfor release_notes %}

What's new in the documentation

- {% include release_notes.html num_dates=3 %} + {% include release_notes.html num_of_releases_to_display=3 release_notes_title="What's new in " %} See full release notes {% endcontentfor %} diff --git a/resources/release-notes.md b/resources/release-notes.md index 2f41095a7..cdf1d35c6 100644 --- a/resources/release-notes.md +++ b/resources/release-notes.md @@ -1,14 +1,12 @@ --- title: Release Notes +release_notes_title: Whats new description: | The **latest** updates about our releases will be published on this page +release_notes: true --- -{% include alert.html type="informative" icon="info" header="Version numbers" -body="The version numbers used in headers on this page refers to the version of -this very documentation, not to a version of any APIs described by it." %} - ## 28 May 2020 ### Version 1.11.0