Tone down legacy warning (#2033)

* Show a red warning only when the doc has moved elsewhere

* Redirect legacy docs to their new home

* Fix wording
This commit is contained in:
Thibault Martin 2023-10-02 15:58:32 +02:00 committed by GitHub
parent f8ac60452f
commit d869cac553
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 31 additions and 6 deletions

View file

@ -1,6 +1,7 @@
+++
title = "Usage of matrix-bot-sdk"
aliases = ["/docs/guides/usage-of-matrix-bot-sdk"]
extra.new_doc = "https://turt2live.github.io/matrix-bot-sdk/index.html"
+++
This article concerns [matrix-bot-sdk], a TypeScript client SDK for Matrix.

View file

@ -1,6 +1,7 @@
+++
title = "matrix-bot-sdk Room Admin Features"
aliases = ["/docs/guides/matrix-bot-sdk-room-admin-features"]
extra.new_doc = "https://turt2live.github.io/matrix-bot-sdk/index.html"
+++
## Intro

View file

@ -2,6 +2,7 @@
title = "Moderation in Matrix"
aliases = ["/docs/guides/moderation"]
extra.updated = "2022-10-18T16:00:00Z"
extra.new_doc = "/docs/communities/moderation/"
+++
## Introduction

View file

@ -1,6 +1,7 @@
+++
title = "Usage of matrix-nio (Python Matrix client library)"
aliases = ["/docs/guides/usage-of-matrix-nio"]
extra.new_doc = "https://matrix-nio.readthedocs.io/en/latest"
+++
This article concerns [matrix-nio](https://github.com/poljar/matrix-nio), and

View file

@ -1,8 +1,8 @@
.legacy-doc-warning {
padding: 1rem;
border-radius: .5rem;
background-color: #FDF5F5;
color: #EC5A5B;
background-color: #F6E7D5;
color: #6F420F;
margin-top: 1rem;
margin-bottom: 1rem;
@ -10,4 +10,9 @@
margin-top: 0px;
margin-bottom: 10px;
}
&.outdated {
background-color: #F6D5D5;
color: #8B1212;
}
}

View file

@ -2,12 +2,28 @@
{% block content %}
<article class="content">
<header>
<div class="legacy-doc-warning">
<h2>Outdated documentation</h2>
<div class="legacy-doc-warning {% if page.extra.new_doc %}outdated{% endif %}">
<h2>
{% if page.extra.new_doc %}
Outdated
{% else %}
Old
{% endif %}
documentation
</h2>
<p>
This article is not actively maintained anymore, it may be
outdated. There may be more current information in
This documentation hasn't been updated in a while. Some
information might no longer be valid.
</p>
<p>
{% if page.extra.new_doc %}
You can find the latest version of the documentation at
<a href="{{ page.extra.new_doc }}">{{ page.extra.new_doc }}</a>
{% else %}
There may be more up to date information in
<a href="/docs">the new documentation section</a>.
{% endif %}
</p>
</div>
<h1>{{ page.title }}</h1>