Skip to content

Commit de1a789

Browse files
authored
feat: Visual indicator for External link in the sidebar
Resolves #240
1 parent 3301549 commit de1a789

File tree

4 files changed

+39
-18
lines changed

4 files changed

+39
-18
lines changed

gulp.d/tasks/generate-octicons.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const icons = [
1616
'info',
1717
'law',
1818
'light-bulb',
19+
'link-external',
1920
'moon',
2021
'question',
2122
'rocket',

preview-src/ui-model.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ shared:
104104
url: '/samples/edge-cases/index.html'
105105
- content: 404
106106
url: '/404.html'
107+
- content: External Link
108+
url: 'https://spring.io'
109+
roles: 'link-external'
110+
target: '_blank'
107111
baz:
108112
1.0.0:
109113
home: true

src/css/nav.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,16 @@ html.is-clipped--nav {
8080
margin: 0 0 0 0.75rem;
8181
}
8282

83+
.nav-list a.link-external::after {
84+
content: url(../img/octicons-16.svg#view-link-external);
85+
width: 16px;
86+
height: 16px;
87+
display: inline-block;
88+
vertical-align: middle;
89+
margin: 0 0 2px 5px;
90+
filter: opacity(0.5);
91+
}
92+
8393
.nav-menu > .nav-list + .nav-list {
8494
margin-top: 0.5rem;
8595
}

src/img/octicons-16.svg

Lines changed: 24 additions & 18 deletions
Loading

0 commit comments

Comments
 (0)