From c9d7f1d54d8b93847d8e291e60770d51cd85bc33 Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Wed, 18 Nov 2020 16:10:56 +0800 Subject: [PATCH 1/3] reviseJarPathDoc --- docs/_config.yml | 1 + docs/_layouts/global.html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/_config.yml b/docs/_config.yml index 3be9807f81082..cf1dc86b92de1 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -26,3 +26,4 @@ SCALA_VERSION: "2.12.10" MESOS_VERSION: 1.0.0 SPARK_ISSUE_TRACKER_URL: https://issues.apache.org/jira/browse/SPARK SPARK_GITHUB_URL: https://github.com/apache/spark +DOCSEARCH_API_KEY: b18ca3732c502995563043aa17bc6ecb \ No newline at end of file diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html index 65af17ed2e4a1..a255d8cd2ec04 100755 --- a/docs/_layouts/global.html +++ b/docs/_layouts/global.html @@ -188,7 +188,7 @@

{{ page.title }}

// to your search input and display its results in a dropdown UI. If you want to find more // details on how works DocSearch, check the docs of DocSearch. docsearch({ - apiKey: 'b18ca3732c502995563043aa17bc6ecb', + apiKey: '{{site.SPARK_VERSION_SHORT}}', indexName: 'apache_spark', inputSelector: '#docsearch-input', enhancedSearchInput: true, From 2da48ff26b59c01b0f70106f4552370132ec19a6 Mon Sep 17 00:00:00 2001 From: Gengliang Wang Date: Wed, 18 Nov 2020 18:29:33 +0800 Subject: [PATCH 2/3] move apikey to config.yml --- docs/_config.yml | 13 ++++++++++++- docs/_layouts/global.html | 9 +-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/_config.yml b/docs/_config.yml index cf1dc86b92de1..cd341063a1f92 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -26,4 +26,15 @@ SCALA_VERSION: "2.12.10" MESOS_VERSION: 1.0.0 SPARK_ISSUE_TRACKER_URL: https://issues.apache.org/jira/browse/SPARK SPARK_GITHUB_URL: https://github.com/apache/spark -DOCSEARCH_API_KEY: b18ca3732c502995563043aa17bc6ecb \ No newline at end of file +# Before a new release, we should apply a new `apiKey` for the new Spark documentation +# on https://docsearch.algolia.com/. Otherwise, after release, the search results are always based +# on the latest documentation(https://spark.apache.org/docs/latest/) even when visiting the +# documentation of previous releases. +DOCSEARCH_SCRIPT: | + docsearch({ + apiKey: 'b18ca3732c502995563043aa17bc6ecb', + indexName: 'apache_spark', + inputSelector: '#docsearch-input', + enhancedSearchInput: true, + debug: false // Set debug to true if you want to inspect the dropdown + }); diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html index a255d8cd2ec04..3b8a6c0abb5a8 100755 --- a/docs/_layouts/global.html +++ b/docs/_layouts/global.html @@ -187,15 +187,8 @@

{{ page.title }}

// 2. a JavaScript snippet to be inserted in your website that will bind this Algolia index // to your search input and display its results in a dropdown UI. If you want to find more // details on how works DocSearch, check the docs of DocSearch. - docsearch({ - apiKey: '{{site.SPARK_VERSION_SHORT}}', - indexName: 'apache_spark', - inputSelector: '#docsearch-input', - enhancedSearchInput: true, - debug: false // Set debug to true if you want to inspect the dropdown - }); + {{site.DOCSEARCH_SCRIPT}} - +