@samitouri / QOS-React / commits / 8886cee285

Added icon for external links in Docs nav and unlinked Complementary Tools and Examples in favor of this icon

Joe Critchley committed Feb 22, 2016 at 22:41 UTC 8886cee285694752a92ede8a28150433c88614cf
5 files changed +26 -1
docs/_data/nav_docs.yml
+2
@@ -14,8 +14,10 @@
14 title: Videos
15 - id: complementary-tools
16 title: Complementary Tools
17 + href: https://github.com/facebook/react/wiki/Complementary-Tools
18 - id: examples
19 title: Examples
20 + href: https://github.com/facebook/react/wiki/Examples
21 - title: Guides
22 items:
23 - id: why-react
docs/_plugins/sidebar_item.rb
+8 -1
@@ -4,7 +4,14 @@ module Jekyll
4 pageID = @context.registers[:page]["id"]
5 itemID = item["id"]
6 href = item["href"] || "/react/docs/#{itemID}.html"
7 - className = pageID == itemID ? ' class="active"' : ''
7 + classes = []
8 + if pageID == itemID
9 + classes.push("active")
10 + end
11 + if item["href"]
12 + classes.push("external")
13 + end
14 + className = classes.size ? "class=\"#{classes.join(' ')}\"" : "";
15
16 return "<a href=\"#{href}\"#{className}>#{item["title"]}</a>"
17 end
docs/css/react.scss
+16
@@ -260,6 +260,22 @@ h1, h2, h3, h4, h5, h6 {
260 &.active {
261 color: $primary;
262 }
263 +
264 + &.external {
265 + &:after {
266 + content: "";
267 + display: inline-block;
268 + width: 10px;
269 + height: 10px;
270 + padding-left: 5px;
271 + @include retina-image('../img/external', 10px 10px);
272 + background-position: 100% 0;
273 + background-repeat: no-repeat;
274 + font-size: 10px;
275 + line-height: 1em;
276 + opacity: 0.5;
277 + }
278 + }
279 }
280
281 .nav-docs-section {
docs/img/external.png
Binary files /dev/null and b/docs/img/external.png differ
docs/img/external_2x.png
Binary files /dev/null and b/docs/img/external_2x.png differ