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

Differentiate between top and bottom prev/next buttons #148

Closed
hagenw opened this issue Jun 8, 2023 · 4 comments
Closed

Differentiate between top and bottom prev/next buttons #148

hagenw opened this issue Jun 8, 2023 · 4 comments

Comments

@hagenw
Copy link
Contributor

hagenw commented Jun 8, 2023

If a documentation contains a lot of short pages it looks a little bit weird that we have prev/next buttons at the top and the bottom, e.g.

image

One solution might be to automatically adjust if we present the buttons at the top depending on the page length.

An easier solution would be to provide different CSS classes for them so a user could write custom CSS code to hide one occurrences of the next/prev buttons. At the moment this is not possible as they are both added to the page with the relbar class. Maybe one could add an additional top and bottom class to them, e.g.

<nav class="relbar top">
@mgeier
Copy link
Owner

mgeier commented Jun 8, 2023

The "relbars" can already be activated and deactivated individually using the relbar1 and relbar2 blocks, as shown in https://insipid-sphinx-theme.readthedocs.io/en/0.4.1/customization.html#custom-templates

This affects all pages, but you might be able to get per-page settings with some additional Jinja2 magic?

@hagenw
Copy link
Contributor Author

hagenw commented Jun 8, 2023

Thanks, I overlooked this. It is indeed straightforward, the _templates/layout.html file just needs to contain:

{% extends "!layout.html" %}

{% block relbar1 %}{% endblock %}

to disable the top next /prev buttons.

@mgeier
Copy link
Owner

mgeier commented Jun 8, 2023

Indeed, the breadcrumbs branch is an example for that: breadcrumbs^...breadcrumbs.

@hagenw
Copy link
Contributor Author

hagenw commented Jun 13, 2023

The current solution seems fine to me. You can close this issue if you like as I don't think it is necessary to provide the functionality of automatically adjusting the visibility of the top and/or bottom prev/next buttons.

@mgeier mgeier closed this as completed Jun 14, 2023
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