Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supported warning to 1.3 #6099

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,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: supported

footer_content:

plugins:
Expand Down
1 change: 0 additions & 1 deletion _includes/warning.html

This file was deleted.

7 changes: 7 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@
{% endif %}
{% endunless %}
<div id="main-content" class="main-content" role="main">
{% 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 @@ -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 {
Expand Down
Loading