From d1f230aff9de6c1b85f1a2125a539e0179f32196 Mon Sep 17 00:00:00 2001 From: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:50:05 -0500 Subject: [PATCH] Add warning capability for OpenSearch section (#6086) Signed-off-by: Fanit Kolchina --- _config.yml | 5 +++++ _layouts/default.html | 7 +++++++ _sass/custom/custom.scss | 21 +++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/_config.yml b/_config.yml index 91ea9727..f810e6c2 100644 --- a/_config.yml +++ b/_config.yml @@ -280,6 +280,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: latest + footer_content: plugins: diff --git a/_layouts/default.html b/_layouts/default.html index cec74cae..bd82803c 100755 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -163,6 +163,13 @@ layout: table_wrappers {% endif %} {% endunless %}
+ {% 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 9ffd1ad7..438ded59 100755 --- a/_sass/custom/custom.scss +++ b/_sass/custom/custom.scss @@ -187,6 +187,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 {