Skip to content

Commit

Permalink
Merge pull request #582 from stephenplusplus/spp--docs-language-switcher
Browse files Browse the repository at this point in the history
docs: add language switcher directive + add Ruby
  • Loading branch information
stephenplusplus committed May 11, 2015
2 parents 8b3f0cf + eb962f1 commit 06aade6
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 17 deletions.
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<script src="site/components/docs/docs-values.js"></script>
<script src="site/components/authorization/authorization.js"></script>
<script src="site/components/faq/faq.js"></script>
<script src="site/components/language-switcher/language-switcher-directive.js"></script>
<script src="site/components/subpage/subpage-directive.js"></script>
<script src="site/components/header/header-directive.js"></script>
<script src="site/components/troubleshooting/troubleshooting.js"></script>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
angular
.module('gcloud.language-switcher', [])
.directive('languageSwitcher', function() {
'use strict';

return {
templateUrl: 'site/components/language-switcher/language-switcher.html',
transclude: true,

controller: function($scope) {
$scope.showNavDropdown = false;
}
};
});
23 changes: 23 additions & 0 deletions docs/site/components/language-switcher/language-switcher.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<nav class="main-nav" ng-class="{ open: showNavDropdown }">
<div class="nav-current" ng-click="showNavDropdown = !showNavDropdown">Node.js</div>
<ul class="menu">
<li>
<a href="#" title="gcloud-node Documentation">
<img src="site/img/icon-lang-nodejs-white.svg" alt="gcloud-node" class="menu-icon">
Node.js
</a>
</li>
<li>
<a href="https://googlecloudplatform.github.io/gcloud-python" title="gcloud-python Documentation">
<img src="site/img/icon-lang-python.svg" alt="gcloud-python" class="menu-icon">
Python
</a>
</li>
<li>
<a href="https://googlecloudplatform.github.io/gcloud-ruby" title="gcloud-ruby Documentation">
<img src="site/img/icon-lang-ruby.svg" alt="gcloud-ruby" class="menu-icon">
Ruby
</a>
</li>
</ul>
</nav>
18 changes: 1 addition & 17 deletions docs/site/components/subpage/subpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,7 @@ <h1 class="logo">
<span class="gcloud">gcloud</span>
</a>
</h1>
<nav class="main-nav" ng-class="{ open: showNavDropdown }">
<div class="nav-current" ng-click="showNavDropdown = !showNavDropdown">Node.js</div>
<ul class="menu">
<li>
<a href="#" title="Node.js docs page">
<img src="site/img/icon-lang-nodejs-white.svg" alt="Node.js icon" class="menu-icon">
Node.js
</a>
</li>
<li>
<a href="https://googlecloudplatform.github.io/gcloud-python" title="Python docs page">
<img src="site/img/icon-lang-python.svg" alt="Python icon" class="menu-icon">
Python
</a>
</li>
</ul>
</nav>
<div language-switcher></div>
</header>

<header ng-if="headerTemplateUrl" ng-include="headerTemplateUrl"></header>
Expand Down
1 change: 1 addition & 0 deletions docs/site/home.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<header class="page-header" role="banner">
<h1 class="logo"><img src="site/img/logo-full.svg" alt="Google Cloud Platform" /></h1>
<div language-switcher></div>
</header><!-- end of .page-header -->

<article class="main" role="main">
Expand Down
1 change: 1 addition & 0 deletions docs/site/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ angular
'gcloud.authorization',
'gcloud.docs',
'gcloud.faq',
'gcloud.language-switcher',
'gcloud.troubleshooting',
'config',
'hljs'
Expand Down

0 comments on commit 06aade6

Please sign in to comment.