Skip to content

Commit

Permalink
Merge pull request #394 from stephenplusplus/spp--gh-pages-timestamp
Browse files Browse the repository at this point in the history
add last built timestamp to master docs - fixes #385
  • Loading branch information
ryanseys committed Feb 16, 2015
2 parents e8b17a2 + 16123dc commit ace863b
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js"></script>
<script src="site/lib/node-semver/semver.browser.js"></script>
<script src="site/lib/angular-markdown-directive/markdown.js"></script>
<script src="site/lib/momentjs/moment.min.js"></script>
<script src="site/home.js"></script>
<script src="site/components/docs/docs.js"></script>
<script src="site/components/docs/docs-directives.js"></script>
Expand Down
3 changes: 3 additions & 0 deletions docs/site/components/docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
links="{{links}}"
header-templateUrl="docs-header.html"
is-active-url="isActiveUrl">

<article ng-show="showReference">
<h3 class="sub-heading">
<div class="toggler" ng-click="showGcloudDocs = !showGcloudDocs">
Expand Down Expand Up @@ -133,6 +134,8 @@ <h4>ACLs</h4>
</p>
</article>

<em ng-if="lastBuiltDate">Docs last built {{lastBuiltDate}}.</em>

<article
ng-repeat="method in methods"
ng-hide="singleMethod && method.name !== singleMethod">
Expand Down
7 changes: 7 additions & 0 deletions docs/site/components/docs/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,13 @@ angular
return 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');
});
}

$scope.pageTitle = 'Node.js';
$scope.showReference = true;
$scope.activeUrl = '#' + $location.path();
Expand Down
22 changes: 22 additions & 0 deletions docs/site/lib/momentjs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Copyright (c) 2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
7 changes: 7 additions & 0 deletions docs/site/lib/momentjs/moment.min.js

Large diffs are not rendered by default.

0 comments on commit ace863b

Please sign in to comment.