From 0c79f3e415b3c0d1d5f6fbfc933f3bfdf3f13c27 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 11:20:47 -0500 Subject: [PATCH] Add unsupported warning to 2.10 and below (#6088) (#6089) (cherry picked from commit 7f3b103aa256ed9f8bc204ce2ef43cea243ce46e) Signed-off-by: Fanit Kolchina Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- _config.yml | 5 +++++ _includes/warning.html | 1 - _layouts/default.html | 8 +++++++- _sass/custom/custom.scss | 21 +++++++++++++++++++++ 4 files changed, 33 insertions(+), 2 deletions(-) delete mode 100644 _includes/warning.html diff --git a/_config.yml b/_config.yml index 7acf9e7a1e..3d178ba47a 100644 --- a/_config.yml +++ b/_config.yml @@ -228,6 +228,11 @@ heading_anchors: false # Adds on-hover anchor links to h2-h6 anchor_links: true +# This setting governs including warning on every page +# 'unsupported' produces red warning, 'supported' produces yellow warning +# everything else produces no warning +doc_version: unsupported + footer_content: plugins: diff --git a/_includes/warning.html b/_includes/warning.html deleted file mode 100644 index 3c9382e159..0000000000 --- a/_includes/warning.html +++ /dev/null @@ -1 +0,0 @@ -

This version of the OpenSearch documentation is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

\ No newline at end of file diff --git a/_layouts/default.html b/_layouts/default.html index a209e60393..52d34e97d3 100755 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -137,7 +137,13 @@ {% endif %} {% endunless %}
- {% include warning.html %} + {% if page.section == "opensearch" %} + {% if site.doc_version == "supported" %} +

This is an earlier version of the OpenSearch documentation. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

+ {% elsif site.doc_version == "unsupported" %} +

This version of the OpenSearch documentation is no longer maintained. For the latest version, see the current documentation. For information about OpenSearch version maintenance, see Release Schedule and Maintenance Policy.

+ {% endif %} + {% endif %} {% if site.heading_anchors != false %} {% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %} {% else %} diff --git a/_sass/custom/custom.scss b/_sass/custom/custom.scss index 745aa5b992..5b958369ea 100644 --- a/_sass/custom/custom.scss +++ b/_sass/custom/custom.scss @@ -167,6 +167,27 @@ img { border-left: 5px solid $red-100; } +@mixin version-warning ( $version: 'latest' ){ + @extend %callout, .panel; + font-weight: 600; + @if $version == 'unsupported' { + border-left: 5px solid $red-100; + background-color: mix(white, $red-100, 80%); + } + @else if $version == 'supported' { + border-left: 5px solid $yellow-000; + background-color: mix(white, $yellow-000, 80%); + } +} + +.supported-version-warning { + @include version-warning('supported'); +} + +.unsupported-version-warning { + @include version-warning('unsupported'); +} + // Labels .label, .label-blue {