Skip to content

Commit

Permalink
Add unsupported warning to 2.10 and below (#6088)
Browse files Browse the repository at this point in the history
Signed-off-by: Fanit Kolchina <[email protected]>
(cherry picked from commit 7f3b103)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Jan 9, 2024
1 parent bdc7c35 commit cbc26ee
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,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:
Expand Down
1 change: 0 additions & 1 deletion _includes/warning.html

This file was deleted.

8 changes: 7 additions & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,13 @@
{% endif %}
{% endunless %}
<div id="main-content" class="main-content" role="main">
{% include warning.html %}
{% if page.section == "opensearch" %}
{% if site.doc_version == "supported" %}
<p class="supported-version-warning">This is an earlier version of the OpenSearch documentation. For the latest version, see the <a href="{{ site.url }}/docs{{ page.url }}">current documentation</a>. For information about OpenSearch version maintenance, see <a href="https://opensearch.org/releases.html">Release Schedule and Maintenance Policy</a>.</p>
{% elsif site.doc_version == "unsupported" %}
<p class="unsupported-version-warning">This version of the OpenSearch documentation is no longer maintained. For the latest version, see the <a href="{{ site.url }}/docs{{ page.url }}">current documentation</a>. For information about OpenSearch version maintenance, see <a href="https://opensearch.org/releases.html">Release Schedule and Maintenance Policy</a>.</p>
{% endif %}
{% endif %}
{% if site.heading_anchors != false %}
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
{% else %}
Expand Down
21 changes: 21 additions & 0 deletions _sass/custom/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit cbc26ee

Please sign in to comment.