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

Version chooser missing after upgrading to 0.34.0 #517

Closed
amotl opened this issue Aug 7, 2024 · 14 comments
Closed

Version chooser missing after upgrading to 0.34.0 #517

amotl opened this issue Aug 7, 2024 · 14 comments

Comments

@amotl
Copy link
Member

amotl commented Aug 7, 2024

Problem

After upgrading to the modernized theme, version choosers are missing at relevant spots.

Thoughts

That's weird, @msbt's most recent preview still displays it.
image

On the theme itself, the version chooser also is present, see https://crate-docs-theme.readthedocs.io/.

@amotl
Copy link
Member Author

amotl commented Aug 7, 2024

@msbt shared that the version chooser will only be rendered conditionally.

{%- if display_version %}
{% include "components/version_chooser.html" %}
{%- endif %}

That's sweet, but why doesn't it work any longer like before?

@msbt
Copy link
Collaborator

msbt commented Aug 7, 2024

@amotl I just compared and before we were using

{%- if versions %}
{% include "version_chooser.html" %}
{%- endif %}

Not sure why it became display_version, but seems like an easy fix - will take care of it tomorrow.

@amotl
Copy link
Member Author

amotl commented Aug 7, 2024

I just compared and before we were using {%- if versions %}.

That was a long time ago already? I can remember we introduced display_version the other day, in order to be more explicit than implicit.

It has 13 hits across the org, so it can't be that wrong, at least it hasn't been in the past. See https://github.com/search?q=org%3Acrate%20display_version&type=code.

@msbt
Copy link
Collaborator

msbt commented Aug 8, 2024

@amotl this is the corresponding commit: 6385993

I'm guessing we did that to enable the verson chooser in the demo theme, right? Which one do you suggest now to bring it back, current_version as it was in that commit or just versions as above?

@amotl
Copy link
Member Author

amotl commented Aug 8, 2024

Yeah, I think we did it because of this, at least that was the beginning of the story. If we should revert that, I don't know. What do you recommend?

Maybe honor both flags? Wouldn't make too much sense, hm?

@msbt
Copy link
Collaborator

msbt commented Aug 8, 2024

@amotl at least when rendering localhost it didn't change anything, same dropdown menus visible.

@amotl
Copy link
Member Author

amotl commented Aug 9, 2024

Maybe the announcement of this display_version variable in some blueprint/master configuration file has been dropped?

@amotl
Copy link
Member Author

amotl commented Aug 9, 2024

html_theme_options are used here:

html_theme_options = {
# HTML navbar class (Default: "navbar") to attach to <div> element.
# For black navbar, do "navbar navbar-inverse"
"navbar_class": "navbar navbar-inverse",
# Fix navigation bar to top of page?
# Values: "true" (default) or "false"
"navbar_fixed_top": "false",
"globaltoc_includehidden": "true",
# HubSpot analytics configuration
"tracking_hubspot_id": environ.get("TRACKING_HUBSPOT_ID", ""),
"tracking_project": "",
# Can be used the query string of a resource URL for HTTP cache busting
"ver": theme.get_version(),
}

Defined, they are over there:
https://github.com/crate/crate-docs-theme/blob/134f2a863633f15d105e0e9bff7635e7f2068b04/src/crate/theme/rtd/crate/theme.conf

Maybe it will be enough to also define display_version here, if it's also treated as a theme option? I may be totally wrong with my assessment, just asking/suggesting without having done any research at all on this topic, yet.

@amotl
Copy link
Member Author

amotl commented Aug 9, 2024

Which one do you suggest now to bring it back, current_version as it was in that commit or just versions as above?

I still think using the proprietary display_version is currently the designated way of enabling the version chooser explicitly per project. If you can convince me to leave this behind, let's please have a session about it.

Otherwise, I think we may want to find out why it stopped working?

NB: I am always 👍 for removing proprietary details in general. However, we don't want to introduce any significant regressions, that's why I am asking so much about this detail ;], and that's why I didn't merge and release your suggestion right away.

@msbt
Copy link
Collaborator

msbt commented Aug 11, 2024

It has 13 hits across the org, so it can't be that wrong, at least it hasn't been in the past. See https://github.com/search?q=org%3Acrate%20display_version&type=code.

@amotl ah yes, good call, but I guess we forgot/missed to add that "display_version": True, snippet to the repos which actually need to have versioned docs, like the reference?

@amotl
Copy link
Member Author

amotl commented Aug 11, 2024

That would be silly, but it's possible. Thanks!

@msbt
Copy link
Collaborator

msbt commented Aug 12, 2024

@amotl So should we first try to update the reference repo to see if the version chooser appears then before changing the theme?

@amotl
Copy link
Member Author

amotl commented Aug 13, 2024

Yeah, I think this would be good. Thanks!

@msbt
Copy link
Collaborator

msbt commented Aug 19, 2024

@amotl setting "display_version": True via https://github.com/crate/crate/pull/16486/files fixed it:
https://cratedb.com/docs/crate/reference/en/latest/

Those repos don't have one as of now, so we should check if it's required there or not:

  • crash
  • croud
  • crate-jdbc
  • crate-operator

@msbt msbt closed this as completed Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants