Skip to content

Commit

Permalink
Finish
Browse files Browse the repository at this point in the history
- ESY-6291 Updated look of Release notes to match Design guide examples
  • Loading branch information
m-lilja committed Apr 10, 2024
1 parent 5c1356e commit 68990b4
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 36 deletions.
3 changes: 1 addition & 2 deletions _includes/alert.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
{% assign header = include.header | markdownify | remove: '<p>' | remove: '</p>' | strip %}
{% assign body = include.body | markdownify | remove: '<p>' | remove: '</p>' | strip %}

<div
class="alert {{ type_class }}">
<div class="alert {{ type_class }}">
{% if icon != blank and icon != empty and icon != nil %}
<i class="material-icons alert-icon mr-3">{{ icon }}</i>
{% endif %}
Expand Down
20 changes: 12 additions & 8 deletions _includes/doc-container.html
Original file line number Diff line number Diff line change
@@ -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 %}

<div class="doc-container {{ max_width_class | strip }}">
<article>
{% 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 %}
</article>
</div>
</div>
95 changes: 75 additions & 20 deletions _includes/release_notes.html
Original file line number Diff line number Diff line change
@@ -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 %}
<div class="release-notes-container">
{% assign dates = page.content | markdownify | split: '<h2' | slice: 1, num_dates %}

{% for date in dates %}
<div class="row">
{% assign versions = date | split: '<h3' %}
{% assign date_id = date | regex_capture: 'id="([^"]+)"' | first %}
<div class="col-md-2 release-notes-date">
{% assign date_value = versions[0] | remove: '</h2>' | split: '>' %}
<a href="{{ release_notes_url }}#{{ date_id }}">{{ date_value[1] | strip }}</a>
{% 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: '</h2>' | size %}
{% assign releases = sitePage.content | markdownify | split: '<h2' | slice: 1, num_of_releases_to_display %}
{% assign archive = sitePage.content | markdownify | split: '<h2' | slice: min_cnt, max_cnt %}
<section class="dg-changelog-container d-flex flex-column mb-0">
<div class="container dg-changelog-content">
<div class="row mt-3">
<span class="dg-changlelog-title">
{{ release_notes_title | append: sitePage.lead_title }}
<div class="dg-changelog-divider my-2"></div>
</span>
{% 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." %}
</div>
{% for release in releases %}
{% if forloop.length > 0 %}
{% if forloop.last %}
<div class="row pb-2 mt-4">
{% else %}
<div class="row border-bottom pb-2 mt-4">
{% endif %}
{% endif %}
{% assign versions = release | split: '<h3' %}
{% assign release_id = release | regex_capture: 'id="([^"]+)"' | first %}
<div class="col-md-2 px-0 pb-2">
{% assign release_value = versions[0] | remove: '</h2>' | split: '>' %}
{{ release_value[1] | strip }}
</div>
{% assign version_list = versions | shift %}
<div class="col-md-10">
{% assign version_list = versions | shift %}
<div class="dg-changelog-description px-0">
{% for version in version_list %}
{% assign version_parts = version | split: '</h3>' %}
{% assign version_value = version_parts[0] | split: '>' %}
{% assign version_id = version | regex_capture: 'id="([^"]+)"' | first %}
<p class="h4"><a href="{{ release_notes_url }}#{{ version_id }}">{{ version_value[1] }}</a></p>
{{ version_parts[1] }}
<h4 class="h4">{{ version_value[1] }}</h4>
<p class="mt-2">{{ version_parts[1] }}</p>
{% endfor %}
</div>
</div>
{% endfor %}
</div>

{% if archive.size > 0 %}
<div class="mb-3">
<div class="accordion ">
<button type="button" class="accordion-header" aria-expanded="false" aria-controls="archive">Archive</button>
<div class="accordion-body" id="archive">
<div class="container dg-changelog-content my-auto">
{% for archive_release in archive %}
{% assign archive_versions = archive_release | split: '<h3' %}
{% assign archive_release_id = archive_release | regex_capture: 'id="([^"]+)"' | first %}
{% assign archive_release_value = archive_versions[0] | remove: '</h2>' | split: '>' %}
{% assign archive_version_list = archive_versions | shift %}
<div class="row border-bottom pb-2 mt-4">
<div class="col-md-2 px-0 pb-2">
{{ archive_release_value[1] | strip }}
</div>
<div class="dg-changelog-description px-0">
{% for archive_version in archive_version_list %}
{% assign archive_version_parts = archive_version | split: '</h3>' %}
{% assign archive_version_value = archive_version_parts[0] | split: '>' %}
{% assign archive_version_id = archive_version | regex_capture: 'id="([^"]+)"' | first %}
<h4 class="h4">{{ archive_version_value[1] }}</h4>
<p class="mt-2">{{ version_parts[1] }}</p>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
{% endif %}

</section>
{% endif %}

{% endfor %}
</div>
{% endif %}
{% endfor %}
2 changes: 1 addition & 1 deletion page1.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ sidebar_icon: filter_1

{% contentfor release_notes %}
<h2 id="front-page-release-notes" class="heading-line heading-line-green">What's new in the documentation</h2>
{% include release_notes.html num_dates=3 %}
{% include release_notes.html num_of_releases_to_display=3 release_notes_title="What's new in " %}
<a href="/resources/release-notes">See full release notes</a>
{% endcontentfor %}

Expand Down
2 changes: 1 addition & 1 deletion page2.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ sidebar_icon: filter_2

{% contentfor release_notes %}
<h2 id="front-page-release-notes" class="heading-line heading-line-green">What's new in the documentation</h2>
{% include release_notes.html num_dates=3 %}
{% include release_notes.html num_of_releases_to_display=3 release_notes_title="What's new in " %}
<a href="/resources/release-notes">See full release notes</a>
{% endcontentfor %}

Expand Down
6 changes: 2 additions & 4 deletions resources/release-notes.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 68990b4

Please sign in to comment.