mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-04-10 14:01:22 -06:00
This is the minimum necessary change to make `back_to_top` work when there is no custom footer, last edit timestamp, or GitHub edit link.
Two immediate thoughts. First, we have a pair of variables: `back_to_top` and `back_to_top_text`. In my opinion, this seems a bit unnecessary; we could just use a `back_to_top`, and treat any non-`nil`/`false` value as the text. We could make this backwards compatible (i.e. support but deprecate `back_to_top_text`). Any thoughts here?
Secondly, some of these conditions are weak:
a251382b7a/_includes/components/footer.html (L7-L9)
Here, this conditional *should* also check for `back_to_top_text`, and presumably, this should "bubble up" to the overall `if` statement on line 4 (similar things for the `gh_*` variables - the line 4 condition only checks for `gh_edit_link`). Is this a reasonable concern/take? If so, I can approach this some time (either in this PR, in another PR, etc.).
---
After we decide the correct behaviour of `back_to_top`, I'll add documentation to the "Configuration" section!
Separately, @pdmosses mentioned:
> The obvious fix is to always render the footer when `site.back_to_top` is set. However, it would improve the usability of the back-to-top feature if individual pages could override the site setting (to suppress the link on some short pages, or to show it on some long pages).
Happy to do that too - for organizational purposes, I'll punt that to another PR (that I can merge into the same release).
---
Fixes #1443.