diff --git a/docs/site/components/docs/docs.html b/docs/site/components/docs/docs.html
index 079531cf1cc..af7af3e80ed 100644
--- a/docs/site/components/docs/docs.html
+++ b/docs/site/components/docs/docs.html
@@ -8,16 +8,6 @@
Report an Issue
-
-
-
Docs last built {{lastBuiltDate}}.
-
diff --git a/docs/site/components/docs/docs.js b/docs/site/components/docs/docs.js
index 24f9ece02e4..bbd4ec34bd0 100644
--- a/docs/site/components/docs/docs.js
+++ b/docs/site/components/docs/docs.js
@@ -260,10 +260,6 @@ angular
.when('/docs', {
redirectTo: '/docs/' + versions[0]
})
- .when('/docs/history', {
- controller: 'HistoryCtrl',
- templateUrl: 'site/components/docs/docs.html'
- })
.when('/docs/:version', {
controller: 'DocsCtrl',
templateUrl: 'site/components/docs/docs.html',
@@ -325,13 +321,6 @@ angular
return !$routeParams.class && doc.toLowerCase() === $routeParams.module;
};
- if ($routeParams.version === 'master') {
- $http.get('https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/commits?sha=gh-pages&per_page=1')
- .then(function(resp) {
- $scope.lastBuiltDate = moment(resp.data[0].commit.committer.date).format('MMMM Do, YYYY');
- });
- }
-
// Set the page title (used in the header).
var pageTitle = [];
@@ -359,12 +348,4 @@ angular
$scope.methods = methods;
$scope.version = $routeParams.version;
$scope.versions = versions;
- })
-
- .controller('HistoryCtrl', function($scope, versions) {
- 'use strict';
-
- $scope.pageTitle = 'Node.js Docs Versions';
- $scope.showHistory = true;
- $scope.versions = versions;
});
diff --git a/docs/site/components/subpage/subpage-directive.js b/docs/site/components/subpage/subpage-directive.js
index 5cde1597ade..9bbff6641f8 100644
--- a/docs/site/components/subpage/subpage-directive.js
+++ b/docs/site/components/subpage/subpage-directive.js
@@ -1,6 +1,6 @@
angular
.module('gcloud.subpage', ['gcloud.header'])
- .directive('subpage', function($rootScope, $location, $parse, getLinks) {
+ .directive('subpage', function($rootScope, $location, $http, $parse, getLinks, versions) {
'use strict';
return {
@@ -11,6 +11,20 @@ angular
$scope.links = getLinks();
$scope.headerTemplateUrl = attrs.headerTemplateurl;
+ $scope.versionSelected = $rootScope.ACTIVE_VERSION;
+ $scope.versions = versions;
+
+ $scope.loadDocsVersion = function(newVersion) {
+ $location.path('docs/' + newVersion);
+ };
+
+ if ($scope.versionSelected === 'master') {
+ $http.get('https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/commits?sha=gh-pages&per_page=1')
+ .then(function(resp) {
+ $scope.lastBuiltDate = moment(resp.data[0].commit.committer.date).format('MMMM Do, YYYY');
+ });
+ }
+
if (attrs.isActiveUrl) {
$scope.isActiveUrl = $parse(attrs.isActiveUrl)($scope);
} else {
diff --git a/docs/site/components/subpage/subpage.html b/docs/site/components/subpage/subpage.html
index de32bd88a3a..b540da1fe64 100644
--- a/docs/site/components/subpage/subpage.html
+++ b/docs/site/components/subpage/subpage.html
@@ -15,6 +15,19 @@