cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblot...@apache.org
Subject docs commit: Making dropdowns preserve /latest/ in their links.
Date Tue, 15 Mar 2016 01:00:36 GMT
Repository: cordova-docs
Updated Branches:
  refs/heads/master 2607400df -> 14d6e28ad


Making dropdowns preserve /latest/ in their links.


Project: http://git-wip-us.apache.org/repos/asf/cordova-docs/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-docs/commit/14d6e28a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-docs/tree/14d6e28a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-docs/diff/14d6e28a

Branch: refs/heads/master
Commit: 14d6e28ad29c5c606d1ac84ee13f2e47d3fa2618
Parents: 2607400
Author: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Authored: Tue Mar 8 15:25:50 2016 -0800
Committer: Dmitry Blotsky <dmitry.blotsky@gmail.com>
Committed: Mon Mar 14 15:13:30 2016 -0700

----------------------------------------------------------------------
 www/_layouts/docs.html | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-docs/blob/14d6e28a/www/_layouts/docs.html
----------------------------------------------------------------------
diff --git a/www/_layouts/docs.html b/www/_layouts/docs.html
index 3c52fce..cd8fba2 100644
--- a/www/_layouts/docs.html
+++ b/www/_layouts/docs.html
@@ -68,8 +68,8 @@ analytics_id: UA-64283057-1
                     {% assign language_id = language_entry[0] %}
                     {% assign language    = language_entry[1] %}
 
-                    {% capture current_language_path %}/docs/{{ page.language }}/{{ page.version
}}/{% endcapture %}
-                    {% capture target_language_path %}/docs/{{ language_id }}/{{ page.version
}}/{% endcapture %}
+                    {% capture current_language_path %}/docs/{{ page.language }}/{% endcapture
%}
+                    {% capture target_language_path %}/docs/{{ language_id }}/{% endcapture
%}
 
                     {% comment %}
                     <!--
@@ -118,8 +118,18 @@ analytics_id: UA-64283057-1
                     <!-- List versions available in this language -->
                     {% for version in site.data.docs-versions.[page.language].versions reversed
%}
                     <li>
+                        {% comment %}
+                        Name the latest version as "latest" to take advantage of
+                        redirects for "/latest/".
+                        {% endcomment %}
+                        {% if version == site.latest_docs_version %}
+                            {% assign version_string = "latest" %}
+                        {% else %}
+                            {% assign version_string = version %}
+                        {% endif %}
+
                         {% capture current_version_path %}/docs/{{ page.language }}/{{ page.version
}}/{% endcapture %}
-                        {% capture target_version_path %}/docs/{{ page.language }}/{{ version
}}/{% endcapture %}
+                        {% capture target_version_path %}/docs/{{ page.language }}/{{ version_string
}}/{% endcapture %}
 
                         {% capture version_entry_string %}
                             {{ version }}


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


Mime
View raw message