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

Back-to-top link not shown #1443

Open
pdmosses opened this issue Mar 21, 2024 · 1 comment · May be fixed by #1461
Open

Back-to-top link not shown #1443

pdmosses opened this issue Mar 21, 2024 · 1 comment · May be fixed by #1461
Labels
bug status: needs discussion Issues that need more discussion before they can be properly triaged.

Comments

@pdmosses
Copy link
Contributor

Describe the bug
The theme has a (currently undocumented) site configuration option back_to_top. The theme docs set this option, and at the bottom of each docs page there is a link to the top of the page. However, this link is shown only when some unrelated options are set.

To Reproduce
Steps to reproduce the behavior:

  1. Clone, build, and serve the theme docs website locally.
  2. See that the "Back to top" link is shown at the bottom of any page.
  3. In _config.yml remove or comment out the settings for footer_content, last_edit_*, and gh_edit_*.
  4. Rebuild and serve the theme docs website locally.
  5. See that the "Back to top" link is no longer shown.

Expected behavior
Whether the "Back to top" link is shown should be independent of the configuration settings for unrelated features.

Screenshots
N/A.

Desktop:

  • OS: macOS
  • Browser: Safari
  • Version: 17.2

Smartphone:
N/A

Additional context
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).

In any case, the back-to-top feature should be explained in the theme docs.

@pdmosses pdmosses added the bug label Mar 21, 2024
@mattxwang
Copy link
Member

Thanks for submitting this issue! I agree with both the expected behavior and additional context points.

Without having implemented it yet, I think the following should be simple-ish to do:

  • render back_to_top even if footer_content/*_edit_* is not set
    • thing to look at: does this look good? unsure
  • allow individual pages to override back_to_top (we've done this before w/ other site config variables)
  • document back_to_top
  • document that the footer will appear if at least one of back_to_top or footer_content or the *_edit_* is specified

Does that seem like it properly captures the issue? If so, we can mark this as ready to implement, and I can add it to my backlog (time to complete is up-in-the-air) and/or have someone else take it on (e.g. you!).


From a bigger picture perspective, it would be great to eventually nest all of these keys under some sort of footer key - that way, it would make it more clear that back_to_top is dependent on the footer being rendered. Ex, I'm thinking something like this:

footer:
    content: "Lorem ipsum..." # this would replace site.footer_content
    back_to_top: true # this would replace site.back_to_top
    # ditto for last_edit, gh_edit, ...

This would be a breaking change, so we'd probably have to defer to a v1. Broadly speaking, do you think this is a good idea?

@mattxwang mattxwang added the status: needs discussion Issues that need more discussion before they can be properly triaged. label Apr 1, 2024
mattxwang added a commit that referenced this issue Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status: needs discussion Issues that need more discussion before they can be properly triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants