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] Added icon for external links in nav #6090

Merged
merged 1 commit into from
Feb 29, 2016

Conversation

joecritch
Copy link
Contributor

  • Added an icon for any external links in the Docs left-hand navigation.
  • Deleted interstitial pages ("Complementary Tools" and "Examples"), in favor of linking directly to GitHub Wiki pages. (The icon now signifies exiting the Docs.)

Screenshot

screen shot 2016-02-22 at 22 42 33

Note

The icon was designed from scratch.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

@jimfb
Copy link
Contributor

jimfb commented Feb 22, 2016

We may want to keep the markdown pages around in order to avoid breaking links. @zpao?

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@joecritch
Copy link
Contributor Author

@jimfb Fair point! I've updated the commit to keep them in. We can deal with cleanup as a separate concern.

@facebook-github-bot
Copy link

@joecritch updated the pull request.

@@ -260,6 +260,22 @@ h1, h2, h3, h4, h5, h6 {
&.active {
color: $primary;
}

&[href*="http"] {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just add a class to these links instead?

href = item["href"] || "/react/docs/#{itemID}.html"
className = pageID == itemID ? ' class="active"' : ''

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zpao Sure, Updated. If the plugin sees an href attribute, it'll add an "external" class.

@facebook-github-bot
Copy link

@joecritch updated the pull request.

@zpao
Copy link
Member

zpao commented Feb 29, 2016

Seems good. Where did the icon come from (want to make sure we have appropriate permissions)?

@joecritch
Copy link
Contributor Author

@zpao Cool. It's from scratch. Sent you the PSD.

@jimfb
Copy link
Contributor

jimfb commented Feb 29, 2016

Ok, I'm cool with this, let's ship it.

jimfb added a commit that referenced this pull request Feb 29, 2016
[Docs] Added icon for external links in nav
@jimfb jimfb merged commit 8f2b7d8 into facebook:master Feb 29, 2016
@jimfb
Copy link
Contributor

jimfb commented Feb 29, 2016

Thanks @joecritch!

if item["href"]
classes.push("external")
end
className = classes.size ? "class=\"#{classes.join(' ')}\"" : "";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't right, here's what gets generated for empty items. I have another thing I want to change so going to follow up.

           <li>
-            <a href="/react/docs/webcomponents.html">Web Components</a>
+            <a href="/react/docs/webcomponents.html"class="">Web Components</a>

           </li>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I'm getting a different output locally (ruby 2.2)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bundle exec? It shouldn't really be a bundler issue though because 0 isn't falsey in Ruby.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah shoot, didn't realise I needed to re-boot bundle exec jekyll after each plugin change. Hence the false positive. Sorry for the mess.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries :) #6151 in case you're interested

zpao pushed a commit that referenced this pull request Mar 7, 2016
[Docs] Added icon for external links in nav
(cherry picked from commit 8f2b7d8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants