-
Notifications
You must be signed in to change notification settings - Fork 5
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
Using RTD's "Version warning" feature #323
Comments
Dear @msbt, thanks for your suggestion. I just checked the projects [1,2] and found the corresponding feature to be enabled already. Now, we might want to investigate why it's not working. On this matter, I discovered this output on the Browser console. Maybe it is the culprit? With kind regards, [1] https://readthedocs.org/dashboard/crate/advanced/ |
@amotl I don't know to be honest, those errors are appearing since we got rid of our custom |
Hah, beat me to it, yes, at least I think that was the time when the error showed up |
I can see |
Hrm odd, maybe I'm remembering it wrong, but I'm pretty sure it was around that time. I'll check back on Monday if I can find something more concrete, sorry for the wild goosechase :/ |
@amotl ok maybe that wasn't it, but we do have one repo with an old template online, I'll compare a current one with https://crate.io/docs/crate/reference/en/3.3/ |
@msbt @amotl I opened a PR which would upgrade docs-theme for crate 3.3 branch to latest version: crate/crate#12209 Preview is here: https://crate--12209.org.readthedocs.build/en/12209/ Just upgrading docs-theme alone does not seem to fix the version-warning though |
Hi again, I just looked up the corresponding implementation by RTD and wanted to share corresponding pointers. They can be useful to find out why it doesn't work on our pages.
I hope this will help to give us a trace to follow. With kind regards, |
Hi again, @msbt found that it works perfectly on the I think this is sweet. @seut: If you don't have any objections, I would prefer using this solution instead of our own thing #322. What do you think about it? 1 With kind regards, Footnotes
|
Hi again, @msbt shared some insights about his investigations with me, thanks a stack.
With kind regards, [1] https://github.com/readthedocs/readthedocs.org/blob/7.4.1/readthedocs/core/static-src/core/js/doc-embed/footer.js#L67 |
Both readthedocs/readthedocs-sphinx-ext#87 and readthedocs/readthedocs-sphinx-ext#88 reference the Code which references Footnotes |
A full All https://crate.readthedocs.io/_/api/v2/footer_html/?project=crate&version=latest All other variants, like omitting the trailing slash, or omitting one of the required parameters, will make the API respond with |
Hi again, I hope that two patches will help to improve the situation. Improve Nginx configurationThe first patch, https://github.com/crate/infrastructure/pull/2850, relates to appropriate Nginx configuration in order to forward query string parameters to an upstream HTTP server using - proxy_pass https://example.readthedocs.io:443/$1;
+ proxy_pass https://example.readthedocs.io:443/$1$is_args$args; Reference/demonstration projects/URLs:
Improve Sphinx/RTD project configurationThe second patch, coming from #326 and #328, attempts to adjust RTD's API URL 2
CreditsThanks again to @msbt for investigating and educating about the background of this issue. With kind regards, Footnotes |
Hi again, the improvements above have been verified on behalf of the Indicator IYou can see that it works by visiting the most recent documentation version at https://crate.io/docs/crate/crash/en/0.27/, where the RTD-native version chooser is now active at the bottom right corner. We probably will want to hide this again at the JavaScript or CSS level. I had already discussed this detail with @msbt. Indicator IIOn the other two documentation versions, after rebuilding them, the RTD-native version warning admonition box is now displayed correctly. Indicator IIIAt https://readthedocs.org/dashboard/crash/traffic-analytics/, we can see that the RTD-native analytics tracking also started working. With kind regards, |
Nice one @amotl, looking good! Now we need to figure out how to block/hide that injected readthedocs box at the bottom right, because all the links it contains are on rtd and not crate.iio (i.e. https://crash.readthedocs.io/en/latest/ and https://crash.readthedocs.io/en/0.27/). Mika started a discussion about that a while back but I don't think this is possible out of the box just yet. It's a shame though, because with that box also come quite a few assets (including fontawesome) which waste traffic if we don't use them. |
I like it as well.
Exactly.
Thank you for refering to this discussion. I think the comment by @humitos at readthedocs/readthedocs.org#3233 (comment) gives some hints how to hide that element again:
I see. Thanks for outlining this. We might want to take care within one of the next iterations. |
That's the thing, I don't think this is true (anymore). It creates a top-level div.injected before the |
The way I got around disabled this in my own themes is by adding a CSS rule of:
since the injected RTD html is wrapped in a div with class |
Dear @autophagy, thanks for your suggestion, @msbt implemented this with 8a46277. Other than this, I also closed #322 because the patches outlined within this discussion enabled us to use the RTD-native version admonition box, see #323 (comment). Following that, I am also closing this issue. Thanks to everyone who participated. With kind regards, |
@amotl maybe a bit late to the party, but can't #322 be resolved via https://docs.readthedocs.io/en/stable/versions.html#version-warning ?
Originally posted by @msbt in #322 (comment)
The text was updated successfully, but these errors were encountered: