]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add a stale version warning + a link to the latest version of docs (#10446)
authorIgor Lukanin <me@igorlukanin.io>
Mon, 18 Jul 2022 10:48:41 +0000 (14:48 +0400)
committerGitHub <noreply@github.com>
Mon, 18 Jul 2022 10:48:41 +0000 (06:48 -0400)
* Add a stale version warning + a link to the latest version of docs

* Update docs/.vuepress/config.js

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
* Shorten the warning

* Revert master title

* Revert master title

Co-authored-by: Jacco van den Berg <jaccoberg2281@gmail.com>
docs/.vuepress/config.js

index e4fb3c1d1887ba8304339670ab08b66f0736f151..77d1d19d971e872ead5132a8d9d6aeb8604af474 100644 (file)
@@ -45,7 +45,11 @@ module.exports = {
     ['@simonbrunel/vuepress-plugin-versions', {
       filters: {
         suffix: (tag) => tag ? ` (${tag})` : '',
-        title: (v, vars) => window.location.href.includes('master') ? 'Development (master)' : v + (vars.tag ? ` (${tag})` : ''),
+        title: (v, vars) => {
+          return window.location.href.includes('master') ? 'Development (master)' :
+                 vars.tag === 'latest' ? 'Latest (' + v + ')' :
+                 v + (vars.tag ? ` (${tag})` : '') + ' (outdated)';
+        },
       },
       menu: {
         text: '{{version|title}}',
@@ -57,6 +61,10 @@ module.exports = {
                 text: 'Development (master)',
                 link: '/docs/master/',
               },
+              {
+                text: 'Latest version',
+                link: '/docs/latest/',
+              },
               {
                 type: 'versions',
                 text: '{{version}}{{tag|suffix}}',