-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Debug navbar code to fix logo broken link #333
Conversation
I don't think this fixes the issue. What you have done is change the You probably have to make changes in line 44 of |
Thanks @agarwalrounak! Was a bit too rash and brash, and have neglected to check everything thoroughly. Thanks for pointing it out. A second commit's been made to render everything internally consistent. |
Hi @agarwalrounak, would you like to check if further changes needed to be made in this PR, and let me know if there is any suggestion to improve on the commits? |
I don't think changing the image source will solve the issue. Have you tried to test your changes locally? I have my exams going on and haven't got the time to set up the project on my system. Otherwise, I would have been able to help you in this regard. |
Hi @agarwalrounak! Yup, I am in the process of testing the changes locally. But will take a while, as this is my first time. I was counting on giles to do the work for me, but now that it's gone I cannot rely on it anymore. No worries, just wanted to see if you would like to contribute more in order to prepare for GSoC 2019 if OpenAstronomy will be selected again as a mentoring organization. All the best on your exams! |
Cannot fix the broken logo link yet, but did debugged other issues with the code. Now the local build works perfect. |
@MananAgarwal Turned out the sidebars including the The logo on the upper left corner is finally showing with external linkage to http://www.astropy.org/astropy-tutorials/ now. |
Hey @kakirastern, It's good to see you work so hard to solve this issue. Other changes that you have made in the template code files are semantic changes. They definitely improve the consistency of the codebase. Thanks for pointing these out. |
Hey @MananAgarwal, thanks for the reply! Sure, at least things work now as far as the upper left corner logo is concerned... Hopefully this quick fix will hold up for a while. |
Maybe I didn't convey myself properly. This implementation is breaking in some pages. |
Yup, have worked out a functional fix... |
I have a feeling we are on the right track, as the real bugs in the tutorials are finally showing... am working on these so as to pass Circle CI and Travis CI one-by-one. |
Everything is okay for now. Will see if this can be merged soon. Thanks @agarwalrounak and @MananAgarwal! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I have a few suggestions:
- It seems like there are a bunch of commits in here that aren't directly related to the PR theme. In the future, just try to keep an eye on this: in general we like to try to keep the number of commits per PR small, and only keep changes directly related to the PR.
- I'm confused about some of the changes here (the ones that seem relevant to this PR), so I've left some inline comments.
Given the complex commit history here, I think the best way forward would be to create a new branch and PR with the changes I suggest, unless you feel comfortable rebasing this one.
Thanks for your work on this!
@@ -96,7 +96,12 @@ | |||
# The name of an image file (within the static path) to use as favicon of the | |||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 | |||
# pixels large. | |||
html_favicon = 'astropy_favicon.ico' | |||
html_favicon = "_static/astropy_favicon.ico" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be changed: if you look at the comment above this block, it says "the name of an image file (within the static path)", so in this case you don't need to preface it with _static
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it without the _static/
path and an error was thrown. And I double-checked on the Internet and someone mentioned that it should be relative to the confdir location, and not relative to the _static/
path... Could you double check for me, maybe it has to do with the html_path_static
path defined after this line? I built the docs locally and if I do what you are suggested this file cannot be found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange - this does remove the WARNING but I don't understand why it seems to work even without it. In any case, keep it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, no problem!
@@ -45,6 +45,7 @@ | |||
"from astropy import units as u\n", | |||
"from astropy.coordinates import SkyCoord\n", | |||
"from astropy.table import Table\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file seem unrelated to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to get Circle CI and Travis CI passed, since some errors related to this file was thrown after I fixed the broken logo link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, but let's fix the travis build in a separate PR, since this is a change to the tutorial content
@@ -30,6 +30,7 @@ | |||
"from astropy import units as u\n", | |||
"from astropy.coordinates import SkyCoord\n", | |||
"from astropy.table import Table\n", | |||
"from astropy.utils import data\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file also seem unrelated to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to previous comment, I was trying to get Circle CI and Travis CI passed, since some errors related to this file was thrown after I fixed the broken logo link.
@@ -27,7 +27,7 @@ | |||
<!DOCTYPE html> | |||
{%- endblock %} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a stylistic change? And are we sure both names are valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed navBar
to nav_bar
so that there will definitely be no confusion in case the system used is not case sensitive.
@@ -44,7 +44,7 @@ globaltoc_includehidden = true | |||
|
|||
# HTML navbar class (Default: "navbar") to attach to <div> element. | |||
# For black navbar, do "navbar navbar-inverse" | |||
navbar_class = navbar | |||
navbar_class = navbar navbar-inverse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this addition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a dark navbar, so navbar-inverse supposedly should be added. Just in case.
I can rebase and squash if necessary... Please advise if any other changes need to be made. |
<nav class="navbar navbar-expand-lg bg-navbar"> | ||
<a class="navbar-brand" href="/astropy-tutorials"style="padding: 0px 5px;"><img src="{{ pathto('_static/' + 'astropy_logo.png') }}" style="height:38px;"></a> | ||
<a class="navbar-brand" href="http://www.astropy.org/astropy-tutorials/" style="padding: 0px 5px;"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to assume the domain here, so change to href="/astropy-tutorials"
@adrn Commits rebased and squashed into one. Okay to merge now. Please double check if necessary. |
@adrn I will open another PR to address the "bugs" showing up on Travis... |
tutorials/conf.py
Outdated
html_favicon = 'astropy_favicon.ico' | ||
html_favicon = "_static/astropy_favicon.ico" | ||
|
||
# (Optional) Logo. Should be small enough to fit the navbar (ideally 24x24). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more thing: please remove these commented-out lines, as we decided they are unnecessary. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, removed...
Change src relative location to fix logo broken link Update astropy_logo.png relative location to show logo image Change logo and banner paths to fix broken links Fixed missing space in L44 of navbar.html Change spacing in navbar code block Comment out button class in navbar code block to test Change bootstrap syntax in navbar code block Get rid of size specification to test navbar code block Fix the img src path for templating Change href to "#" to test navbar code block Add size specifications and empty alt to test navbar Change width and height specifications to test navbar code Change logo size to fit navbar Use "style" to specify height to test navbar code block Add html_logo assignment to theme.conf file Remove quotation marks for logo file name in theme.conf Make further changes to theme.conf file to test theme code Remove quotation marks around nav for source_link_position Change navBar to navbar to test theme code Revert changes from navbar to nav_bar for macro to test Add html_logo = "astropy_logo.png" to conf.py Remove logo portion that has been misplaced Change True back to true in theme.conf Revert to original syntax used with "style" Add missing space in code to test Change img src formatting to test navbar code Comment out astropy html favicon and logo files in conf.py Restore favicon definition statement in conf.py Clean up conf.py file Comment out button class in navbar code block to test Comment out nav-brand class to test navbar code block Rewrite navbar code snippets in navbar.html to test Change navbar code snippets back to test navbar.html Clean up navbar.html Polishing up on navbar.html to test code Clean up navbar.html further by getting rid of spaces Change width and height properties to fit logo in navbar Change html_favicon location to try and pick it up Change navbar properties to try to show logo Get rid of redundant "navbar" term in navbar.html Revert back to previous navbar.html settings Change height of logo to unhide image Change relative path of img src to try and pick up logo Change CSS attributes in navbar.html to test code Continue changing CSS attributes to test navbar code Uncomment html_logo path in conf.py file Correct logo path redirect to rst-tutorials behavior Change width of logo by implicit ratio-aspect lock Correct logo link redirection behavior To [http://www.astropy.org/astropy-tutorials/](http://www.astropy.org/astropy-tutorials/). Using HTML onerror attribute to correct remaining broken error link Fix syntax error in navbar.html file Add missing space and forward slash in L44 of navbar.html Change syntax to try and debug navbar.html Update coordinates.ipynb to debug NameResolveError NameResolveError: All Sesame queries failed. Unable to retrieve coordinates. Update Coordinates-Intro to debug NameResolveError Change data.conf.remote_timeout location and value in coordinates.ipynb Further update Coordinates-Intro.ipynb to debug Change name used in Sesame query to debug Revise syntax of img src for logo Remove html_logo from conf.py Change href for navbar-brand from html to relative path Revert Coordinates-Intro changes Get rid of redundant spaces in L93 Revert changes made to coordinates.ipynb tutorial Undo explicit print statement Remove unnecessary comments regarding html_logo
Thanks @kakirastern! |
You are welcome, @adrn! |
Solution not working completely. Have opened PR #339 to address that. |
Sorry, my bad, it works now... Was definitely too rash and brash. |
Fixes #323.
Attempts to mend broken Astropy logo banner link on the tutorial pages, in order for the image on the left hand side of the Learn Astropy navbar to show properly.