You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/01/19 10:55:39 UTC

[GitHub] [arrow] jorisvandenbossche commented on a change in pull request #12172: ARROW-14338: [Docs] Add version dropdown to the pkgdown (R) docs

jorisvandenbossche commented on a change in pull request #12172:
URL: https://github.com/apache/arrow/pull/12172#discussion_r787628619



##########
File path: r/pkgdown/extra.js
##########
@@ -59,6 +77,45 @@
       var empty_ul = $("#toc").find("ul").filter(":empty");
       empty_ul.remove();
     });
+
+    $(document).ready(function () {
+  
+      /**
+       * This replaces the package version number in the docs with a
+       * dropdown where you can select the version of the docs to view.
+       */
+
+        $pathStart = function(){
+    	  return window.location.origin + "/docs/";
+        }
+
+        $pathEnd  = function(){
+      	  var current_path = window.location.pathname;
+      	  return current_path.match("(?<=\/r).*");
+        }
+
+        // Load the versions JSON and construct the select items
+        $.getJSON("./versions.json", function( data ) {

Review comment:
       The "./versions.json", is that a relative path to the current location? Because that might not work if you have sub-directories in the docs (like for the articles) 
   
   Or does that point to a "root" file? (in which case it would always be arrow.apache.org/versions.json once deployed, which might also not be correct?)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org