-
Notifications
You must be signed in to change notification settings - Fork 203
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
Fix new sidebar changes #1579
Fix new sidebar changes #1579
Conversation
Now that I think about it, I don't think docs.rs css files have versions. Do we have a way to make it work starting a given rustdoc version? |
There's also an issue that the first scroll of the body causes the sidebar to also scroll up on new docs. |
Indeed, good catch. I'll send a fix for the scroll bug. Any idea for the css versioning? |
5a768dc
to
dd6e72b
Compare
We could take advantage of rustdoc options to solve this issue. For example using |
dbff700
to
4aa248e
Compare
Something kinda like this would work. Having a CSS file based on the rustdoc version would be even better (and it can be included into the header instead of the inlined CSS I put as a POC!). |
0d936f0
to
82c5404
Compare
I finally did as follows: we generate a new |
This does not seem like a sustainable, long-term solution. It looks like the |
I'll take a look. If the date is included in the version, then we will be able to completely go around this problem! |
e32ddde
to
60c8bd9
Compare
@notriddle Thanks a lot for your idea! It allowed me to determine when receiving the query for |
Using the recorded date rather than changing the generated docs is definitely much nicer. I think rather than sending the date as part of the request query I think we should just embed different |
You mean generating the correct CSS path depending on the rustdoc version in the tera template? |
Yep. |
Makes sense! I'll update to do so then. |
384ebf5
to
cd49cb1
Compare
Updated! Thanks a lot for the suggestion @Nemo157! |
cd49cb1
to
b45c723
Compare
b45c723
to
b9d2930
Compare
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 add a test or two for the new file? All the stringly-typed "rustdoc-2"s make me nervous.
b9d2930
to
888f979
Compare
Good idea! I will do soon. |
888f979
to
dc9a8c5
Compare
Actually I'm wondering: what tests do you have in mind? |
9dd2edf
to
747a28c
Compare
747a28c
to
88e2435
Compare
I added a test @jyn514. Hope it's the one you had in mind. |
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, this is great, thanks!
I did a manual test, I see that new doc-builds are definitely fixed, and the additional CSS file is added only in docs built with newer rustc version. So that's fine with me. @Nemo157 @GuillaumeGomez did one of you do a manual test of the last version with old docs? I recently wiped my local db & s3, so I don't have any. If you don't have them either, I would fetch some old archives from S3. If that's tested I'll merge and deploy. |
I painfully did. :') |
Reading my question from yesterday evening again my wording was a little off. I mean a manual test with the latest state in this PR, testing a release / build that was done before december 6th. |
I understood it this way and I confirm that's what I did. ;) |
Fixes #1574.
This PR fixes a few issues following the sidebar layout changes.