You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by mc...@apache.org on 2020/03/13 20:28:26 UTC

[cassandra-website] branch master updated: Provide listing of the versioned docs that exist already in the website, with aliases for 'latest' and 'stable, with the default link as latest.

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

mck pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cassandra-website.git


The following commit(s) were added to refs/heads/master by this push:
     new e72b0ba  Provide listing of the versioned docs that exist already in the website, with aliases for 'latest' and 'stable, with the default link as latest.
e72b0ba is described below

commit e72b0ba1258fb37d39204ad5688a31a84744067c
Author: mck <mc...@apache.org>
AuthorDate: Sun Dec 8 19:59:55 2019 +0100

    Provide listing of the versioned docs that exist already in the website, with aliases for 'latest' and 'stable, with the default link as latest.
    
     patch Mick Semb Wever and Rahul Singh; reviewed by Jon Haddad for CASSANDRA-14954
---
 src/.htaccess          |  3 ---
 src/Makefile           |  5 +++++
 src/README             |  8 ++++----
 src/_includes/nav.html |  4 ++--
 src/doc/.htaccess      |  2 ++
 src/doc/index.html     | 13 -------------
 src/doc/stable         |  1 +
 7 files changed, 14 insertions(+), 22 deletions(-)

diff --git a/src/.htaccess b/src/.htaccess
index a254c35..e69de29 100644
--- a/src/.htaccess
+++ b/src/.htaccess
@@ -1,3 +0,0 @@
-RewriteEngine On
-
-RewriteRule /doc/ /doc/latest/ [NC,L]
diff --git a/src/Makefile b/src/Makefile
index fc49ee2..6758bfa 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -30,6 +30,9 @@ endif
 .latest-doc-link:
 	@ln -s -f -T $(DOC_VERSION) "doc/latest"
 
+.stable-doc-link:
+	@ln -s -f -T $(DOC_VERSION) "doc/stable"
+
 build:
 	@bundle exec jekyll build
 
@@ -42,3 +45,5 @@ serve:
 add-doc: .build-doc build
 
 add-latest-doc: .build-doc .latest-doc-link build
+
+add-stable-doc: .build-doc .stable-doc-link build
diff --git a/src/README b/src/README
index 7e574a9..80ff3af 100644
--- a/src/README
+++ b/src/README
@@ -57,10 +57,10 @@ update the documentation, you need to:
    cassandra git sources
 2. set the CASSANDRA_DIR environment variable to that git source checkout (pro-tip: it's a good idea to export that
    variable in your bashrc/zshrc/whatev).
-3. use `make add-doc` or `make add-latest-doc` from this repository. The `add-latest-doc` target should be used when you
-   want the generated doc replace the "default" documentation, the one you get when you click "documentation" on the
-   website. This is often the one you want. You should use `add-doc` when you want to rebuild the doc for an old version
-   for some reason (such doc is accessible from /doc/<version>).
+3. use `make add-doc` (or `make add-latest-doc` or `add-stable-doc`) from this repository. 
+   The `add-stable-doc` target should be used when you want the generated doc replace the "default" documentation, 
+   the one you get when you click "documentation" on the website.  Use `add-latest-doc` for trunk. 
+   You should use `add-doc` when you want to rebuild the doc for an old version.
 
 Layout
 ------
diff --git a/src/_includes/nav.html b/src/_includes/nav.html
index da17cc8..e3f34dc 100644
--- a/src/_includes/nav.html
+++ b/src/_includes/nav.html
@@ -24,7 +24,7 @@
 
       {% unless page.is_homepage %}
         {% if page.is_sphinx_doc %}
-        <li><a href="{{ base }}doc">{{ page.title }}</a></li>
+        <li><a href="{{ base }}doc/latest/">{{ page.title }}</a></li>
         {% else %}
         <li>{{ page.title }}</li>
         {% endif %}
@@ -57,7 +57,7 @@
         <ul class="nav navbar-nav navbar-right">
           <li><a href="{{ base }}">Home</a></li>
           <li><a href="{{ base }}download/">Download</a></li>
-          <li><a href="{{ base }}doc/">Documentation</a></li>
+          <li><a href="{{ base }}doc/latest/">Documentation</a></li>
           <li><a href="{{ base }}community/">Community</a></li>
           <li>
             <a href="{{ base }}blog/">Blog</a>
diff --git a/src/doc/.htaccess b/src/doc/.htaccess
new file mode 100644
index 0000000..c744671
--- /dev/null
+++ b/src/doc/.htaccess
@@ -0,0 +1,2 @@
+Options +Indexes
+IndexOptions +VersionSort
diff --git a/src/doc/index.html b/src/doc/index.html
index 93a7231..e69de29 100644
--- a/src/doc/index.html
+++ b/src/doc/index.html
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-<!-- HTML redirect to the latest documentation. Using HTML redirect is a bit ugly, but it's only used for local
-  testing: the website uses the .htaccess file for this, but that file doesn't work locally with 'jekyll serve' -->
-<html lang="en-US">
-  <head>
-    <meta charset="UTF-8">
-    <meta http-equiv="refresh" content="0;url=./latest/">
-    <title>Page Redirection</title>
-  </head>
-  <body>
-    If you are not redirected automatically, click <a href='./latest'>here</a>
-  </body>
-</html>
diff --git a/src/doc/stable b/src/doc/stable
new file mode 120000
index 0000000..902b2c9
--- /dev/null
+++ b/src/doc/stable
@@ -0,0 +1 @@
+3.11
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org