This is an automated email from the ASF dual-hosted git repository.

kamilbregula pushed a commit to branch airflow-2-0-docs
in repository https://gitbox.apache.org/repos/asf/airflow-site.git

commit f3d1e9e799d8113cffeb12428f96c57a99d31ed2
Author: Kamil BreguĊ‚a <[email protected]>
AuthorDate: Thu Nov 26 18:45:40 2020 +0100

    Support multiple documentation packages
---
 .../0.0.1/index.html                               |   2 +
 .../0.0.2/index.html                               |   2 +
 .../apache-airflow-providers-google/metadata.yaml  |   5 -
 .../apache-airflow-providers-google/stable.txt     |   1 +
 .../apache-airflow-providers/index.html            |   1 +
 dump-docs-package-metadata.py                      |  43 ++++++--
 landing-pages/site/content/en/docs/_index.md       | 122 ++++++++++-----------
 landing-pages/site/static/.htaccess                |  13 ++-
 landing-pages/src/js/versionSelector.js            |   4 +-
 requirements.txt                                   |   1 +
 site.sh                                            |  66 ++++++++---
 sphinx_airflow_theme/demo/index.rst                |   6 +-
 .../demo/nested/deep-nested/index.rst              |  21 ----
 sphinx_airflow_theme/demo/nested/index.rst         |  24 ----
 sphinx_airflow_theme/setup.py                      |   2 +-
 15 files changed, 167 insertions(+), 146 deletions(-)

diff --git 
a/docs-packages-archive/apache-airflow-providers-google/0.0.1/index.html 
b/docs-packages-archive/apache-airflow-providers-google/0.0.1/index.html
new file mode 100644
index 0000000..d06c23b
--- /dev/null
+++ b/docs-packages-archive/apache-airflow-providers-google/0.0.1/index.html
@@ -0,0 +1,2 @@
+
+Placeholder for apache-airflow-providers-google v0.0.1
diff --git 
a/docs-packages-archive/apache-airflow-providers-google/0.0.2/index.html 
b/docs-packages-archive/apache-airflow-providers-google/0.0.2/index.html
new file mode 100644
index 0000000..ec91c9d
--- /dev/null
+++ b/docs-packages-archive/apache-airflow-providers-google/0.0.2/index.html
@@ -0,0 +1,2 @@
+
+Placeholder for apache-airflow-providers-google v0.0.2
diff --git 
a/docs-packages-archive/apache-airflow-providers-google/metadata.yaml 
b/docs-packages-archive/apache-airflow-providers-google/metadata.yaml
deleted file mode 100644
index 8a808f1..0000000
--- a/docs-packages-archive/apache-airflow-providers-google/metadata.yaml
+++ /dev/null
@@ -1,5 +0,0 @@
----
-package-name: "apache-airflow-providers-google"
-stable-version: "0.0.1"
-all-versions:
-  - "0.0.1"
diff --git a/docs-packages-archive/apache-airflow-providers-google/stable.txt 
b/docs-packages-archive/apache-airflow-providers-google/stable.txt
new file mode 100644
index 0000000..4e379d2
--- /dev/null
+++ b/docs-packages-archive/apache-airflow-providers-google/stable.txt
@@ -0,0 +1 @@
+0.0.2
diff --git a/docs-packages-archive/apache-airflow-providers/index.html 
b/docs-packages-archive/apache-airflow-providers/index.html
new file mode 100644
index 0000000..7c84423
--- /dev/null
+++ b/docs-packages-archive/apache-airflow-providers/index.html
@@ -0,0 +1 @@
+Placeholder for apache-airflow-providers
diff --git a/dump-docs-package-metadata.py b/dump-docs-package-metadata.py
index 5f59bfa..092870f 100644
--- a/dump-docs-package-metadata.py
+++ b/dump-docs-package-metadata.py
@@ -1,27 +1,48 @@
-import glob
 import json
 import sys
 
-import yaml
 import os
+from typing import List
+import semver
 
-ROOT_DIR = os.path.dirname(os.path.join(os.path.abspath(__file__), 
os.path.pardir))
 
-def load_yaml(filepath: str):
-    with open(filepath) as f:
-        return yaml.safe_load(f)
+ROOT_DIR = 
os.path.dirname(os.path.join(os.path.dirname(os.path.abspath(__file__)), 
os.path.pardir))
+APACHE_AIRFLOW_ARCHIVE = os.path.join(ROOT_DIR, "docs-archive")
+PACKAGE_ARCHIVE = os.path.join(ROOT_DIR, "docs-packages-archive")
+
+
+def get_all_versions(directory: str) -> List[str]:
+    return sorted(
+        (f for f in os.listdir(directory) if 
os.path.isdir(os.path.join(directory, f))),
+        key=lambda d: semver.VersionInfo.parse(d),
+    )
+
+
+def get_stable_version(directory: str):
+    with open(os.path.join(directory, "stable.txt")) as f:
+        return f.read().strip()
 
 
 def dump_docs_package_metadata():
-    to_load_paths = [
-        'docs-archive/metadata.yaml'
+    all_packages_infos = [
+        {
+            "package-name": "apache-airflow",
+            "stable-version": get_stable_version(APACHE_AIRFLOW_ARCHIVE),
+            "all-versions": get_all_versions(APACHE_AIRFLOW_ARCHIVE),
+        }
     ]
 
-    to_load_paths.extend(
-        glob.glob("docs-packages-archive/*/metadata.yaml")
+    all_packages_infos.extend(
+        {
+            "package-name": f,
+            "stable-version": get_stable_version(os.path.join(PACKAGE_ARCHIVE, 
f)),
+            "all-versions": get_all_versions(os.path.join(PACKAGE_ARCHIVE, f)),
+        }
+        for f in os.listdir(PACKAGE_ARCHIVE)
+        if os.path.exists(os.path.join(PACKAGE_ARCHIVE, f, "stable.txt"))
     )
 
-    all_packages_infos = [load_yaml(f) for f in to_load_paths]
     json.dump(all_packages_infos, sys.stdout, indent=2)
 
+
 dump_docs_package_metadata()
diff --git a/landing-pages/site/content/en/docs/_index.md 
b/landing-pages/site/content/en/docs/_index.md
index 4b5a9b4..7042fa4 100644
--- a/landing-pages/site/content/en/docs/_index.md
+++ b/landing-pages/site/content/en/docs/_index.md
@@ -9,7 +9,7 @@ menu:
 ---
 # Documentation
 
-## [Apache Airflow](/docs/apache-airflow/latest/index.html)
+## [Apache Airflow](/docs/apache-airflow/stable/index.html)
 
 Apache Airflow Core, which includes webserver, scheduler, CLI and other 
components that are needed for minimal Airflow installation.
 
@@ -18,66 +18,66 @@ Apache Airflow Core, which includes webserver, scheduler, 
CLI and other componen
 Providers packages include integrations with third party integrations. They 
are updated independently of the Apache Airflow core.
 
 <ul class="list-providers">
-    <li><a 
href="/docs/apache-airflow-providers-amazon/latest/index.html">Amazon</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-cassandra/latest/index.html">Apache 
Cassandra</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-druid/latest/index.html">Apache 
Druid</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-hdfs/latest/index.html">Apache 
HDFS</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-hive/latest/index.html">Apache 
Hive</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-kylin/latest/index.html">Apache 
Hive</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-livy/latest/index.html">Apache 
Livy</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-pig/latest/index.html">Apache 
Pig</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-pinot/latest/index.html">Apache 
Pinot</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-spark/latest/index.html">Apache 
Spark</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-apache-sqoop/latest/index.html">Apache 
Sqoop</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-celery/latest/index.html">Celery</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-cloudant/latest/index.html">IBM 
Cloudant</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-cncf-kubernetes/latest/index.html">Kubernetes</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-databricks/latest/index.html">Databricks</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-datadog/latest/index.html">Datadog</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-dingding/latest/index.html">Dingding</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-discord/latest/index.html">Discord</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-docker/latest/index.html">Docker</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-elasticsearch/latest/index.html">Elasticsearch</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-exasol/latest/index.html">Exasol</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-facebook/latest/index.html">Facebook</a></li>
-    <li><a href="/docs/apache-airflow-providers-ftp/latest/index.html">File 
Transfer Protocol (FTP)</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-google/latest/index.html">Google</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-grpc/latest/index.html">gRPC</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-hashicorp/latest/index.html">Hashicorp</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-http/latest/index.html">Hypertext Transfer 
Protocol (HTTP)</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-imap/latest/index.html">Internet Message 
Access Protocol (IMAP)</a></li>
-    <li><a href="/docs/apache-airflow-providers-jdbc/latest/index.html">Java 
Database Connectivity (JDBC)</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-jenkins/latest/index.html">Jenkins</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-jira/latest/index.html">Jira</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-microsoft-azure/latest/index.html">Microsoft
 Azure</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-microsoft-mssql/latest/index.html">Microsoft
 SQL Server (MSSQL)</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-microsoft-winrm/latest/index.html">Windows 
Remote Management (WinRM)</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-mongo/latest/index.html">MongoDB</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-mysql/latest/index.html">MySQL</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-odbc/latest/index.html">ODBC</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-openfaas/latest/index.html">OpenFaaS</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-opsgenie/latest/index.html">Opsgenie</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-oracle/latest/index.html">Orcle</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-pagerduty/latest/index.html">Pagerduty</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-papermill/latest/index.html">Papermill</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-plexus/latest/index.html">Plexus</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-postgres/latest/index.html">PostgreSQL</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-presto/latest/index.html">Presto</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-qubole/latest/index.html">Qubole</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-redis/latest/index.html">Redis</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-salesforce/latest/index.html">Salesforce</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-samba/latest/index.html">Samba</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-segment/latest/index.html">Segment</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-sendgrid/latest/index.html">Sendgrid</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-sftp/latest/index.html">SFTP</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-singularity/latest/index.html">Singularity</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-slack/latest/index.html">Slack</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-snowflake/latest/index.html">Snowflake</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-sqlite/latest/index.html">SQLite</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-ssh/latest/index.html">SSH</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-vertica/latest/index.html">Vertica</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-yandex/latest/index.html">Yandex</a></li>
-    <li><a 
href="/docs/apache-airflow-providers-zendesk/latest/index.html">Zendesk</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-amazon/stable/index.html">Amazon</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-cassandra/stable/index.html">Apache 
Cassandra</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-druid/stable/index.html">Apache 
Druid</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-hdfs/stable/index.html">Apache 
HDFS</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-hive/stable/index.html">Apache 
Hive</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-kylin/stable/index.html">Apache 
Hive</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-livy/stable/index.html">Apache 
Livy</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-pig/stable/index.html">Apache 
Pig</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-pinot/stable/index.html">Apache 
Pinot</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-spark/stable/index.html">Apache 
Spark</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-apache-sqoop/stable/index.html">Apache 
Sqoop</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-celery/stable/index.html">Celery</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-cloudant/stable/index.html">IBM 
Cloudant</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-cncf-kubernetes/stable/index.html">Kubernetes</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-databricks/stable/index.html">Databricks</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-datadog/stable/index.html">Datadog</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-dingding/stable/index.html">Dingding</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-discord/stable/index.html">Discord</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-docker/stable/index.html">Docker</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-elasticsearch/stable/index.html">Elasticsearch</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-exasol/stable/index.html">Exasol</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-facebook/stable/index.html">Facebook</a></li>
+    <li><a href="/docs/apache-airflow-providers-ftp/stable/index.html">File 
Transfer Protocol (FTP)</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-google/stable/index.html">Google</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-grpc/stable/index.html">gRPC</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-hashicorp/stable/index.html">Hashicorp</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-http/stable/index.html">Hypertext Transfer 
Protocol (HTTP)</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-imap/stable/index.html">Internet Message 
Access Protocol (IMAP)</a></li>
+    <li><a href="/docs/apache-airflow-providers-jdbc/stable/index.html">Java 
Database Connectivity (JDBC)</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-jenkins/stable/index.html">Jenkins</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-jira/stable/index.html">Jira</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-microsoft-azure/stable/index.html">Microsoft
 Azure</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-microsoft-mssql/stable/index.html">Microsoft
 SQL Server (MSSQL)</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-microsoft-winrm/stable/index.html">Windows 
Remote Management (WinRM)</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-mongo/stable/index.html">MongoDB</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-mysql/stable/index.html">MySQL</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-odbc/stable/index.html">ODBC</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-openfaas/stable/index.html">OpenFaaS</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-opsgenie/stable/index.html">Opsgenie</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-oracle/stable/index.html">Orcle</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-pagerduty/stable/index.html">Pagerduty</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-papermill/stable/index.html">Papermill</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-plexus/stable/index.html">Plexus</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-postgres/stable/index.html">PostgreSQL</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-presto/stable/index.html">Presto</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-qubole/stable/index.html">Qubole</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-redis/stable/index.html">Redis</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-salesforce/stable/index.html">Salesforce</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-samba/stable/index.html">Samba</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-segment/stable/index.html">Segment</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-sendgrid/stable/index.html">Sendgrid</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-sftp/stable/index.html">SFTP</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-singularity/stable/index.html">Singularity</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-slack/stable/index.html">Slack</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-snowflake/stable/index.html">Snowflake</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-sqlite/stable/index.html">SQLite</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-ssh/stable/index.html">SSH</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-vertica/stable/index.html">Vertica</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-yandex/stable/index.html">Yandex</a></li>
+    <li><a 
href="/docs/apache-airflow-providers-zendesk/stable/index.html">Zendesk</a></li>
 </ul>
 
 <style>
diff --git a/landing-pages/site/static/.htaccess 
b/landing-pages/site/static/.htaccess
index db35686..192a19a 100644
--- a/landing-pages/site/static/.htaccess
+++ b/landing-pages/site/static/.htaccess
@@ -1,6 +1,7 @@
-RedirectMatch Permanent ^/docs/(stable|1.10.10)/api(\.html)?$ 
"https://airflow.apache.org/docs/$1/rest-api-ref";
-RedirectMatch Permanent ^/docs/(stable|1.10.10)/(cli|macros)(\.html)?$ 
"https://airflow.apache.org/docs/$1/$2-ref";
-RedirectMatch Permanent ^/((_api|_images|_modules|_sources|_static|howto)/.*)$ 
"https://airflow.apache.org/docs/stable/$1";
-RedirectMatch Permanent 
^/((1.10.1|1.10.2|1.10.3|1.10.4|1.10.5|1.10.6|1.10.7|1.10.8|1.10.9|1.10.10)/.*)$
 "https://airflow.apache.org/docs/$1";
-RedirectMatch Permanent 
^/((api|changelog|cli|concepts|errors|faq|genindex|http-routingtable|installation|integration|kubernetes|license|lineage|macros|metrics|plugins|privacy_notice|profiling|project|py-modindex|scheduler|search|security|start|timezone|tutorial|ui)(\.html)?)$
 "https://airflow.apache.org/docs/stable/$1";
-Redirect Permanent /objects.inv 
https://airflow.apache.org/docs/stable/objects.inv
+RedirectMatch Permanent ^/docs/(stable|1.10.10)/api(\.html)?$ 
"https://airflow.apache.org/docs/apache-airflow/$1/rest-api-ref";
+RedirectMatch Permanent ^/docs/(stable|1.10.10)/(cli|macros)(\.html)?$ 
"https://airflow.apache.org/docs/apache-airflow/$1/$2-ref";
+RedirectMatch Permanent ^/((_api|_images|_modules|_sources|_static|howto)/.*)$ 
"https://airflow.apache.org/docs/apache-airflow/stable/$1";
+RedirectMatch Permanent 
^/((1.10.1|1.10.2|1.10.3|1.10.4|1.10.5|1.10.6|1.10.7|1.10.8|1.10.9|1.10.10)/.*)$
 "https://airflow.apache.org/docs/apache-airflow/$1";
+RedirectMatch Permanent 
^/docs/((1.10.1|1.10.2|1.10.3|1.10.4|1.10.5|1.10.6|1.10.7|1.10.8|1.10.9|1.10.10|1.10.11|1.10.12|1.10.13)/.*)$
 "https://airflow.apache.org/docs/apache-airflow/$1";
+RedirectMatch Permanent 
^/((api|changelog|cli|concepts|errors|faq|genindex|http-routingtable|installation|integration|kubernetes|license|lineage|macros|metrics|plugins|privacy_notice|profiling|project|py-modindex|scheduler|search|security|start|timezone|tutorial|ui)(\.html)?)$
 "https://airflow.apache.org/docs/apache-airflow/stable/$1";
+Redirect Permanent /objects.inv 
https://airflow.apache.org/docs/apache-airflow/stable/objects.inv
diff --git a/landing-pages/src/js/versionSelector.js 
b/landing-pages/src/js/versionSelector.js
index e986b09..9551e90 100644
--- a/landing-pages/src/js/versionSelector.js
+++ b/landing-pages/src/js/versionSelector.js
@@ -21,12 +21,13 @@ import {compareVersion} from "./sortVersions";
 
 const getCurrentPageInfo = () => {
 
-  const [, ,currentPackageName, currentVersion, ...pagePathParts] = 
document.location.pathname.split("/");
+  const [, , currentPackageName, currentVersion, ...pagePathParts] = 
document.location.pathname.split("/");
   const pagePath = pagePathParts.join("/");
   return {currentVersion, currentPackageName, pagePath};
 };
 
 const updateVersionSelector = (versionSelector, packageAllVersions, 
stableVersion) => {
+  // eslint-disable-next-line no-console
   console.log("updateVersionSelector:", {versionSelector, packageAllVersions, 
stableVersion});
 
   const templateText = 
versionSelector.querySelector("#version-item-template").innerText;
@@ -66,6 +67,7 @@ const runVersionSelector = () => {
         console.error(`Unable to find package info for ${currentPackageName}`);
         return;
       }
+      // eslint-disable-next-line no-console
       console.log("currentPackageInfo=", currentPackageInfo);
 
       const packageAllVersions = 
currentPackageInfo["all-versions"].sort(compareVersion).reverse();
diff --git a/requirements.txt b/requirements.txt
index 319161e..1e52d65 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,3 @@
 pre-commit==1.18.3
 PyYAML==5.3.1
+semver==2.13.0
diff --git a/site.sh b/site.sh
index ff8988b..fe53bce 100755
--- a/site.sh
+++ b/site.sh
@@ -115,7 +115,7 @@ function ensure_that_website_is_build {
     if [[ ! -f landing-pages/dist/index.html ]] ; then
         log "The website is not built. Start building."
         run_command "/opt/site/landing-pages/" npm run build
-        log "The website builded."
+        log "The website built."
     fi
 }
 
@@ -227,6 +227,25 @@ function build_landing_pages {
     run_command "/opt/site/landing-pages/" npm run build
 }
 
+function create_index {
+    output_path="$1/index.html"
+    log "Creating index: ${output_path}"
+    cat > "${output_path}" << EOF
+<!DOCTYPE html>
+<html>
+   <head><meta http-equiv="refresh" content="1; url=stable/" /></head>
+   <body></body>
+</html>
+EOF
+}
+
+function verbose_cp_r {
+    source=$1
+    target=$2
+    log "Copying '$source' to '$target'"
+    mkdir -p "${target}"
+    cp -R "$source" "$target"
+}
 function build_site {
     log "Building full site"
 
@@ -235,22 +254,39 @@ function build_site {
     fi
     mkdir -p dist
     rm -rf dist/*
+    log "## Copying docs for apache-airflow package"
+    log "Copying 'landing-pages/dist/.' to 'dist/'"
     cp -R landing-pages/dist/. dist/
     mkdir -p dist/docs/
-#    rm -rf dist/docs/*
-
-#    for doc_path in docs-archive/*/ ; do
-#        version="$(basename -- "${doc_path}")"
-#        cp -R "${doc_path}" "dist/docs/${version}/"
-#    done
-#    cp -R "docs-archive/$(cat docs-archive/stable.txt)" "dist/docs/stable/"
-#    cat > dist/docs/index.html << EOF
-#<!DOCTYPE html>
-#<html>
-#   <head><meta http-equiv="refresh" content="1; url=stable/" /></head>
-#   <body></body>
-#</html>
-#EOF
+
+    for doc_path in docs-archive/*/ ; do
+        version="$(basename -- "${doc_path}")"
+        verbose_cp_r "${doc_path}" "dist/docs/apache-airflow/${version}/"
+    done
+    verbose_cp_r "docs-archive/$(cat docs-archive/stable.txt)" 
"dist/docs/apache-airflow/stable/"
+    create_index 'dist/docs/apache-airflow'
+    log "Copying docs for providers"
+    for D in docs-packages-archive/*; do
+        if [ ! -d "${D}" ]; then
+            continue;
+        fi
+        package_name="$(basename -- "${D}")"
+        # Is this documentation versioned?
+        if [ -f "${D}/stable.txt" ]; then
+            for doc_path in "${D}"/*/ ; do
+                version="$(basename -- "${doc_path}")"
+                verbose_cp_r "${doc_path}" 
"dist/docs/${package_name}/${version}/"
+            done
+            stable_version="$(cat "${D}/stable.txt")"
+            verbose_cp_r "${D}/${stable_version}/" 
"dist/docs/${package_name}/stable/"
+            create_index "dist/docs/${package_name}"
+        else
+            verbose_cp_r "${D}/" "dist/docs/${package_name}/"
+        fi
+    done;
+
+    log "Preparing dist/_gen/packages-metadata.json"
+    python dump-docs-package-metadata.py > "dist/_gen/packages-metadata.json"
 }
 
 
diff --git a/sphinx_airflow_theme/demo/index.rst 
b/sphinx_airflow_theme/demo/index.rst
index 816b5a3..ab1d133 100644
--- a/sphinx_airflow_theme/demo/index.rst
+++ b/sphinx_airflow_theme/demo/index.rst
@@ -18,15 +18,19 @@
 Welcome to Theme demo's documentation!
 ======================================
 
+AAA
+
 .. toctree::
     :maxdepth: 1
     :caption: References
 
     playground
-    nested/index
+
+AAA
 
 Indices and tables
 ==================
 
 * :ref:`genindex`
+* :ref:`modindex`
 * :ref:`search`
diff --git a/sphinx_airflow_theme/demo/nested/deep-nested/index.rst 
b/sphinx_airflow_theme/demo/nested/deep-nested/index.rst
deleted file mode 100644
index 7c7f17f..0000000
--- a/sphinx_airflow_theme/demo/nested/deep-nested/index.rst
+++ /dev/null
@@ -1,21 +0,0 @@
- .. Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
- ..   http://www.apache.org/licenses/LICENSE-2.0
-
- .. Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
-Deep nested page
-================
-
-Deep nested.
diff --git a/sphinx_airflow_theme/demo/nested/index.rst 
b/sphinx_airflow_theme/demo/nested/index.rst
deleted file mode 100644
index 56a732b..0000000
--- a/sphinx_airflow_theme/demo/nested/index.rst
+++ /dev/null
@@ -1,24 +0,0 @@
- .. Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
- ..   http://www.apache.org/licenses/LICENSE-2.0
-
- .. Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-
-Nested page
-===========
-
-.. toctree::
-    :maxdepth: 1
-
-    deep-nested/index
diff --git a/sphinx_airflow_theme/setup.py b/sphinx_airflow_theme/setup.py
index 09b7769..2031c6d 100644
--- a/sphinx_airflow_theme/setup.py
+++ b/sphinx_airflow_theme/setup.py
@@ -21,7 +21,7 @@ from setuptools import setup
 REQUIRED_ADDITIONAL_FILES=[
     "sphinx_airflow_theme/static/_gen/css/main.min.css",
     "sphinx_airflow_theme/static/_gen/css/main-custom.min.css",
-    "sphinx_airflow_theme/static/_gen/js/docs.js"""
+    "sphinx_airflow_theme/static/_gen/js/docs.js"
 ]
 missing_files = [
     f

Reply via email to