Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: updates to language links #838

Merged
merged 1 commit into from
Sep 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,29 @@ angular
return {
templateUrl: 'site/components/language-switcher/language-switcher.html',
transclude: true,

link: function($scope, elem, attrs) {
$scope.extraLinks = $parse(attrs.extraLinks)($scope);
$scope.showNavDropdown = false;
},
controller: function($scope, $attrs) {
this.useApiDocs = $parse($attrs.useApiDocs)($scope);
}
};
})
.directive('apiDocs', function() {
'use strict';

return {
require: '^languageSwitcher',
restrict: 'A',
scope: {
href: '@',
apiDocs: '@'
},
link: function (scope, elem, attrs, switcher) {
if (switcher.useApiDocs) {
elem.attr('href', scope.href + scope.apiDocs);
}
}
};
});
6 changes: 3 additions & 3 deletions docs/site/components/language-switcher/language-switcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,19 @@ <h4 class="list-item--heading">gcloud Libraries</h4>
</a>
</li>
<li>
<a href="#" title="gcloud-node Documentation" class="skip-external-link">
<a href="#" api-docs="/docs" title="gcloud-node Documentation" class="skip-external-link">
<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/latest" title="gcloud-python Documentation" class="skip-external-link">
<a href="https://googlecloudplatform.github.io/gcloud-python" api-docs="/stable" title="gcloud-python Documentation" class="skip-external-link">
<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/docs/latest" title="gcloud-ruby Documentation" class="skip-external-link">
<a href="https://googlecloudplatform.github.io/gcloud-ruby" api-docs="/docs/latest" title="gcloud-ruby Documentation" class="skip-external-link">
<img src="site/img/icon-lang-ruby.svg" alt="gcloud-ruby" class="menu-icon">
Ruby
</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/components/subpage/subpage.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h1 class="logo">
</a>
</h1>

<div language-switcher extra-links="{{links}}"></div>
<div language-switcher use-api-docs="true" extra-links="{{links}}"></div>

<div class="header--right">
<a href="https://github.com/GoogleCloudPlatform/gcloud-node/issues/new"
Expand Down