Skip to content

Commit 227d200

Browse files
Merge pull request #592 from stephenplusplus/spp--docs-external-link-icon
site: add external link - fixes #552
2 parents 8c3719f + b2f43b5 commit 227d200

5 files changed

Lines changed: 27 additions & 8 deletions

File tree

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<link rel="shortcut icon" href="https://cloud.google.com/images/gcp-favicon.ico">
1313
<link rel="stylesheet" href="site/css/normalize.css">
1414
<link rel="stylesheet" href="site/css/main.css">
15+
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
1516
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Droid+Sans+Mono|Roboto:300,400,700,700italic,400italic|Open+Sans:300">
1617
<link rel="stylesheet" href="site/lib/highlight/github.min.css">
1718
</head>

docs/site/components/docs/docs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="row row--right">
44
<div class="col margin-vertical">
55
<a href="https://github.com/GoogleCloudPlatform/gcloud-node/issues/new"
6-
class="v-btn">
6+
class="v-btn skip-external-link">
77
<img src="site/img/icon-link-github.svg" />
88
Report an Issue
99
</a>

docs/site/components/language-switcher/language-switcher.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
<div class="nav-current" ng-click="showNavDropdown = !showNavDropdown">Node.js</div>
33
<ul class="menu">
44
<li>
5-
<a href="#" title="gcloud-node Documentation">
5+
<a href="#" title="gcloud-node Documentation" class="skip-external-link">
66
<img src="site/img/icon-lang-nodejs-white.svg" alt="gcloud-node" class="menu-icon">
77
Node.js
88
</a>
99
</li>
1010
<li>
11-
<a href="https://googlecloudplatform.github.io/gcloud-python" title="gcloud-python Documentation">
11+
<a href="https://googlecloudplatform.github.io/gcloud-python" title="gcloud-python Documentation" class="skip-external-link">
1212
<img src="site/img/icon-lang-python.svg" alt="gcloud-python" class="menu-icon">
1313
Python
1414
</a>
1515
</li>
1616
<li>
17-
<a href="https://googlecloudplatform.github.io/gcloud-ruby" title="gcloud-ruby Documentation">
17+
<a href="https://googlecloudplatform.github.io/gcloud-ruby" title="gcloud-ruby Documentation" class="skip-external-link">
1818
<img src="site/img/icon-lang-ruby.svg" alt="gcloud-ruby" class="menu-icon">
1919
Ruby
2020
</a>

docs/site/components/subpage/subpage.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,25 @@ <h1 class="logo">
5454

5555
<ul class="external-links">
5656
<li>
57-
<a href="https://github.com/GoogleCloudPlatform/gcloud-node" title="gcloud-node on Github">
57+
<a href="https://github.com/GoogleCloudPlatform/gcloud-node" title="gcloud-node on Github" class="skip-external-link">
5858
<img src="site/img/icon-link-github.svg" alt="GitHub icon" />
5959
GitHub
6060
</a>
6161
</li>
6262
<li>
63-
<a href="https://github.com/GoogleCloudPlatform/gcloud-node/issues" title="gcloud-node issues on Github">
63+
<a href="https://github.com/GoogleCloudPlatform/gcloud-node/issues" title="gcloud-node issues on Github" class="skip-external-link">
6464
<img src="site/img/icon-link-github.svg" alt="GitHub icon" />
6565
Issues
6666
</a>
6767
</li>
6868
<li>
69-
<a href="http://stackoverflow.com/questions/tagged/gcloud-node" title="gcloud-node on StackOverflow">
69+
<a href="http://stackoverflow.com/questions/tagged/gcloud-node" title="gcloud-node on StackOverflow" class="skip-external-link">
7070
<img src="site/img/icon-link-stackoverflow.svg" alt="StackOverflow icon" />
7171
StackOverflow
7272
</a>
7373
</li>
7474
<li>
75-
<a href="http://npmjs.org/package/gcloud" title="gcloud-node on npm">
75+
<a href="http://npmjs.org/package/gcloud" title="gcloud-node on npm" class="skip-external-link">
7676
<img src="site/img/icon-link-package-manager.svg" alt="npm icon" />
7777
npm
7878
</a>

docs/site/css/main.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,24 @@ html {
2323
line-height: 1.4;
2424
}
2525

26+
/*
27+
target external links:
28+
- that have an href attribute (excludes JavaScript links)
29+
- that start with #/ (relative)
30+
- that start with / (absolute)
31+
- that link to "."
32+
- that aren't ".ext-link" -- already styled external links on the site (found in the header and navigation)
33+
- that aren't ".skip-external-link" -- a custom class used to indicate "don't style me as an external link" for complete control
34+
*/
35+
a[href]:not([href^="#/"]):not([href^="/"]):not([href="."]):not(.ext-link):not(.skip-external-link) {
36+
text-decoration: none;
37+
}
38+
a[href]:not([href^="#/"]):not([href^="/"]):not([href="."]):not(.ext-link):not(.skip-external-link):after {
39+
font: normal normal normal 14px/1 FontAwesome;
40+
content: " \f08e";
41+
color: #666;
42+
}
43+
2644
/*
2745
* Remove text-shadow in selection highlight: h5bp.com/i
2846
* These selection rule sets have to be separate.

0 commit comments

Comments
 (0)