From 5f7f9b15523aef3c2c1e581f626fd91ae29df2c6 Mon Sep 17 00:00:00 2001 From: Jim Date: Mon, 29 Feb 2016 15:19:25 -0800 Subject: [PATCH] Merge pull request #6090 from joecritch/docs-external-link-icon [Docs] Added icon for external links in nav (cherry picked from commit 8f2b7d8e7141d5719591c7b0fcf3a6cfd5606a69) --- docs/_data/nav_docs.yml | 2 ++ docs/_plugins/sidebar_item.rb | 9 ++++++++- docs/css/react.scss | 16 ++++++++++++++++ docs/img/external.png | Bin 0 -> 1245 bytes docs/img/external_2x.png | Bin 0 -> 1151 bytes 5 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 docs/img/external.png create mode 100644 docs/img/external_2x.png diff --git a/docs/_data/nav_docs.yml b/docs/_data/nav_docs.yml index 86f44eb75a318..e3b5183ffa030 100644 --- a/docs/_data/nav_docs.yml +++ b/docs/_data/nav_docs.yml @@ -14,8 +14,10 @@ title: Videos - id: complementary-tools title: Complementary Tools + href: https://github.com/facebook/react/wiki/Complementary-Tools - id: examples title: Examples + href: https://github.com/facebook/react/wiki/Examples - title: Guides items: - id: why-react diff --git a/docs/_plugins/sidebar_item.rb b/docs/_plugins/sidebar_item.rb index a5dda30c771c0..bfb218b8823b9 100644 --- a/docs/_plugins/sidebar_item.rb +++ b/docs/_plugins/sidebar_item.rb @@ -4,7 +4,14 @@ def sidebar_item_link(item) pageID = @context.registers[:page]["id"] itemID = item["id"] href = item["href"] || "/react/docs/#{itemID}.html" - className = pageID == itemID ? ' class="active"' : '' + classes = [] + if pageID == itemID + classes.push("active") + end + if item["href"] + classes.push("external") + end + className = classes.size ? "class=\"#{classes.join(' ')}\"" : ""; return "#{item["title"]}" end diff --git a/docs/css/react.scss b/docs/css/react.scss index 4bbb8cad08d00..c7326af4dd4d7 100644 --- a/docs/css/react.scss +++ b/docs/css/react.scss @@ -260,6 +260,22 @@ h1, h2, h3, h4, h5, h6 { &.active { color: $primary; } + + &.external { + &:after { + content: ""; + display: inline-block; + width: 10px; + height: 10px; + padding-left: 5px; + @include retina-image('../img/external', 10px 10px); + background-position: 100% 0; + background-repeat: no-repeat; + font-size: 10px; + line-height: 1em; + opacity: 0.5; + } + } } .nav-docs-section { diff --git a/docs/img/external.png b/docs/img/external.png new file mode 100644 index 0000000000000000000000000000000000000000..423ec131b9d4cf220d819666e13af29c05027b5e GIT binary patch literal 1245 zcmbVMTWB0r7#>L?X=osZ+M-f=nEFs*ckYwTOn2NQJG<>dHwl}iNkOr*GiNtLG8bn~ z+({^Hx71Jti9`^=;024mNRt$_l#<@eOP`cJ_@I%ZzDPvdMr;*H)-$`==tC&tJk0se zKi~J?|9Ne&|4@6|(`^Jnv}X>hIedn4TkGTa{Ra2t5h zR)RUG8Iv#Hf^mXq3e5Zn8p$4!b;qK#5JLr)i`fJbPXw-}k3j?quw>c_dH2dS5}1ZU z4vSeP>n7o-d3ef$LsR{EeQHdX3^MUNhzBw@U_qpTz#6xGIZ()&T^Y-vnkGRFg2oiG z9@I#75F{NB0+H&9>P%M*#3YIpV=*BX0UX1MG{e(86XkeWU}S*>DVB&s1=+E zq>wn$dJ2}C&2AaC{mnw*lF@gW>|v{6P?Nc@E|Ohe{4LFyJ*Evj=|Au5Pak7`AUiFS7h zqE-+zqsVX#JKOO^KF#*=X+~vLiDgrw6jOOs$1wMxt8 zHc|Yy3e@?=|E(a6gQCN6`PcX~RCp#sacddyWowUSR4=0oA KS1ZO+oDtd}~sE2|cN~p-7C@3(Cie3z&hoCl6713Zr(_~XHV^_Cd+o*F@O)a1zdzaqS{S2k3ian!zhcOIdSwEYNn{l z(8>+qflQBPxHbzT9X7N*f~KhE*3g5-D8e9*hAk&Sf4l#H29}wi4=Ncx@3MTTfF!Gwch$T&fLnL$T^;aeWITn9vqFz=4z1Wi0$4#D;^nN?yZ zSVS7zGBr_@)h1bhj3J77Mplr)z=Fy%O)*)4c^R4oUM%yhg;%6b zAt`mFbU{}Ip+iyQx}+;oQi{c8QIhpCHthr$ItD7+wuo&>SC#grB>z{emhutAuAg(= zv2qvmjkwqiMqCf1Ql+YcJsD_NP9$uI3bh=!j(qDFGCO_O2Bl1E)*4>?TLzZ#=Kp4p zBTjKqyZq5UWfAGgXuCQLg?_QC4?VOH*86b z&DwQu+vaBBiMp9t;oMSknyr8GT(9jsb3QG6Z57xv^cysPkFVIrZCJWFzdlx1dAxlv zEkCq?ADiFw>dv0U?%JBEyZwiz`ajP6yaB=D;O4DE)B