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

jiayu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-sedona.git


The following commit(s) were added to refs/heads/master by this push:
     new 1957b969 [DOCS] Use mkdocs-mike to add versioning to Sedona website
1957b969 is described below

commit 1957b9694685cdae62a37a1fe54023d915a8a5bf
Author: Jia Yu <[email protected]>
AuthorDate: Thu Dec 22 23:43:29 2022 -0700

    [DOCS] Use mkdocs-mike to add versioning to Sedona website
---
 .github/workflows/docs.yml |  3 ++-
 docs-overrides/main.html   |  8 ++++++++
 docs/community/publish.md  | 35 +++++++++++++++++++----------------
 docs/setup/compile.md      |  5 ++++-
 mkdocs.yml                 |  2 ++
 5 files changed, 35 insertions(+), 18 deletions(-)

diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 3b1ea4b7..1ce89255 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -20,6 +20,7 @@ jobs:
     - run: pip install mkdocs-material
     - run: pip install mkdocs-macros-plugin
     - run: pip install mkdocs-git-revision-date-localized-plugin
+    - run: pip install mike
     - run: sudo apt update
     - run: sudo apt install littler tree libcurl4-openssl-dev
     - run: (sudo Rscript generate-docs.R)
@@ -38,7 +39,7 @@ jobs:
           ${{ runner.os }}-pip-
 
     - run: (cd docs/api/rdocs/; sudo tree -H '.' -L 1 --noreport --charset 
utf-8 -o index.html)
-    - run: mkdocs build
+    - run: mike deploy --update-aliases current-snapshot
     - run: mkdir staging
     - run: cp -r site/* staging/
     - uses: actions/upload-artifact@v2
diff --git a/docs-overrides/main.html b/docs-overrides/main.html
index 0062a68f..2b19a88f 100644
--- a/docs-overrides/main.html
+++ b/docs-overrides/main.html
@@ -2,6 +2,14 @@
   This file was automatically generated - do not edit
 -#}
 {% extends "base.html" %}
+
+{% block outdated %}
+  You're not viewing the latest version.
+  <a href="{{ '../' ~ base_url }}"> 
+    <strong>Click here to go to latest.</strong>
+  </a>
+{% endblock %}
+
 {% block content %}
   {% if page.is_homepage %}
   <!-- {{ super() }} -->
diff --git a/docs/community/publish.md b/docs/community/publish.md
index b5ffaba5..3f6c7f92 100644
--- a/docs/community/publish.md
+++ b/docs/community/publish.md
@@ -469,26 +469,19 @@ Then submit to CRAN using this [web 
form](https://xmpalantir.wu.ac.at/cransubmit
 
 ## 11. Publish the doc website
 
-1. Add the download link to [Download page](/download#versions) and create a 
GitHub release.
-2. Run `mkdocs build` in Sedona root directory. Copy all content in the `site` 
folder.
-3. Check out GitHub incubator-sedona-website [asf-site 
branch](https://github.com/apache/incubator-sedona-website/tree/asf-site)
-4. Use the copied content to replace all content in `asf-site` branch and 
upload to GitHub. Then `sedona.apache.org` will be automatically updated.
-5. You can also push the content to `asf-staging` branch. The staging website 
will be then updated: `sedona.staged.apache.org`
+### Prepare the environment and doc folder
 
-### Javadoc and Scaladoc
+1. Check out the {{ sedona_create_release.current_version }} Git tag on your 
local repo.
+2. Read [Compile documentation 
website](/setup/compile/#compile-the-documentation) to set up your environment. 
But don't deploy anything yet.
+3. Add the download link to [Download page](/download#versions).
+4. Add the news to `docs/index.md`.
 
-#### Compile
+### Generate Javadoc and Scaladoc
 
-You should first compile the entire docs using `mkdocs build` to get the 
`site` folder.
-
-* Javadoc: Use Intelij IDEA to generate Javadoc for `core` and `viz` module
-* Scaladoc: Run `scaladoc -d site/api/javadoc/sql/ 
sql/src/main/scala/org/apache/sedona/sql/utils/*.scala`
-
-#### Copy
-
-1. Copy the generated Javadoc (Scaladoc should already be there) to the 
corresponding folders in `site/api/javadoc`
-2. Deploy Javadoc and Scaladoc with the project website
+* Javadoc: Use Intelij IDEA to generate Javadoc for `core` and `viz` module, 
output them to `docs/api/javadoc`
+* Scaladoc: Run `scaladoc -d docs/api/javadoc/sql/ 
sql/src/main/scala/org/apache/sedona/sql/utils/*.scala`
 
+Please do not commit these generated docs to Sedona GitHub.
 
 ### Compile R html docs
 
@@ -502,3 +495,13 @@ sudo apt install littler tree libcurl4-openssl-dev
 Rscript generate-docs.R
 cd ./docs/api/rdocs && tree -H '.' -L 1 --noreport --charset utf-8 -o 
index.html && cd ../../../
 ```
+
+### Deploy the website
+
+1. Run `mike deploy --push --update-aliases {{ 
sedona_create_release.current_version }} latest`. This will deploy this website 
to Sedona main repo's gh-page. But Sedona does not use gh-page for hosting 
website.
+2. Check out the master branch.
+3. Git commit and push your changes in `download.md` and `index.md` to master 
branch. Delete all generated docs.
+4. Check out the `gh-page` branch.
+5. In a separate folder, check out GitHub sedona-website [asf-site 
branch](https://github.com/apache/incubator-sedona-website/tree/asf-site)
+6. Copy all content to in Sedona main repo `gh-page` branch to Sedona website 
repo `asf-site` branch.
+7. Commit and push the changes to the remote `asf-site` branch.
\ No newline at end of file
diff --git a/docs/setup/compile.md b/docs/setup/compile.md
index d02da42b..e17e99cd 100644
--- a/docs/setup/compile.md
+++ b/docs/setup/compile.md
@@ -105,11 +105,14 @@ pip install mkdocs
 pip install mkdocs-material
 pip install mkdocs-macros-plugin
 pip install mkdocs-git-revision-date-localized-plugin
+pip install mike
 ```
 
 After installing MkDocs and MkDocs-Material, run the command in Sedona root 
folder:
 
 ```
-mkdocs serve
+mike deploy --update-aliases current-snapshot latest
+mike set-default latest
+mike serve
 ```
 
diff --git a/mkdocs.yml b/mkdocs.yml
index b53bae11..8862440e 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -157,6 +157,8 @@ theme:
     - search.highlight
     - search.share
 extra:
+  version:
+    provider: mike
   social:
     - icon: fontawesome/brands/github-alt
       link: 'https://github.com/apache/incubator-sedona'

Reply via email to