+ {% include oldDocsWarning.html %} {{content}}
diff --git a/docs/_includes/oldDocsWarning.html b/docs/_includes/oldDocsWarning.html new file mode 100644 index 0000000000..627b1adbad --- /dev/null +++ b/docs/_includes/oldDocsWarning.html @@ -0,0 +1,13 @@ + +{% if version and version != versions.stable %} +
+
+ {% assign upToDateURL = page.url | makeURLForStable %} +

✋ These are the docs for PouchDB version {{version}}. The current stable release is {{versions.stable}}.

+ {% if version == 'latest'%} +

These docs are only relevant if you are building from source.

+ {% endif %} +
+
+
+{% endif %} \ No newline at end of file diff --git a/docs/src/less/pouchdb/alerts.less b/docs/src/less/pouchdb/alerts.less index 6865ba38bb..eac2464fce 100644 --- a/docs/src/less/pouchdb/alerts.less +++ b/docs/src/less/pouchdb/alerts.less @@ -46,3 +46,9 @@ background-color: lighten(@alert-danger-bg, 3%); color: @alert-danger-text; } + +.old-docs-warning { + position: sticky; + top: 0; + z-index: 2; +} \ No newline at end of file From 6a1dd625f91ca294110c88101aed2aee5c6e9079 Mon Sep 17 00:00:00 2001 From: Alex Feyerke Date: Mon, 11 May 2026 10:21:35 +0200 Subject: [PATCH 06/13] feat: add a component on all versioned pages to switch between docs versions --- docs/_includes/2ColLeft.html | 6 ++--- docs/_includes/versionSwitcher.html | 27 +++++++++++++++++++++ docs/src/less/pouchdb/pouchdb.less | 2 ++ docs/src/less/pouchdb/version-switcher.less | 11 +++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 docs/_includes/versionSwitcher.html create mode 100644 docs/src/less/pouchdb/version-switcher.less diff --git a/docs/_includes/2ColLeft.html b/docs/_includes/2ColLeft.html index 85d0b3fa89..c845a28776 100644 --- a/docs/_includes/2ColLeft.html +++ b/docs/_includes/2ColLeft.html @@ -24,8 +24,8 @@ {% include oldDocsWarning.html %} {{content}}
- -
- + +
+ {% include versionSwitcher.html %}