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

Don't depend of enabled pdf/epub to show downloads #5502

Merged
merged 4 commits into from Mar 19, 2019

Conversation

@stsewd
Copy link
Member

@stsewd stsewd commented Mar 19, 2019

Fixes #5497

We just need to rely if the epub/pdf exists, we already do this with the localmedia download.

@stsewd stsewd requested a review from Mar 19, 2019
@@ -258,32 +256,25 @@ def get_subdomain_url(self):
def get_downloads(self, pretty=False):
project = self.project
data = {}
if pretty:
Copy link
Member Author

@stsewd stsewd Mar 19, 2019

This code was duplicates, just refactored it to something simpler

Copy link
Member

@ericholscher ericholscher left a comment

Good fix. I wonder if there are other pieces of logic around this that need to change with the config files.

@stsewd
Copy link
Member Author

@stsewd stsewd commented Mar 19, 2019

Apart from the documentation_type #4638 I don't think so.

@stsewd stsewd merged commit a639939 into readthedocs:master Mar 19, 2019
1 check passed
@stsewd stsewd deleted the fix-downloads-display branch Mar 19, 2019
self.slug,
)
if project.has_htmlzip(self.slug):
data[prettify('HTML')] = project.get_production_media_url(
Copy link
Contributor

@davidfischer davidfischer Apr 6, 2019

Suggested change
data[prettify('HTML')] = project.get_production_media_url(
data[prettify('HTMLZIP')] = project.get_production_media_url(

I believe this should be HTMLZIP instead of HTML. The template that displays these links checks for dict.htmlzip.

Copy link
Member Author

@stsewd stsewd Apr 8, 2019

Yeah, I just realized that when prettify was set, we named this to html instead of htmlzip. I need to see if we use this in the footer api, or maybe it's safe to rename the template.

Copy link
Member Author

@stsewd stsewd Apr 8, 2019

We currently use the name HTML in the footer api and on the theme https://github.com/rtfd/sphinx_rtd_theme/blob/a49a812c8821123091166fae1897d702cdc2d627/sphinx_rtd_theme/versions.html#L17-L21

So, it's safe to rename this in the template

Copy link
Member Author

@stsewd stsewd Apr 8, 2019

stsewd added a commit to stsewd/readthedocs.org that referenced this issue Apr 8, 2019
In readthedocs#5502 we refactored the function
but we used to depend on `pretty` to change the name of the key from
`html` to `htmlzip`, we use `html` in the footer and in the theme.

So, it's safe to change the value in the template.

See https://github.com/rtfd/readthedocs.org/pull/5502/files#r272787188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants