-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Simplify navbar #3681
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
base: master
Are you sure you want to change the base?
Simplify navbar #3681
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, although the removal of the next_prev
block probably is a breaking change?
Good pointer, thanks. I've re-included it as an empty block here and amended the docs marginally. |
The removal of the "Edit on GitHub" text might obscure the purpose of the GitHub icon in the navbar. If this simplification is still desirable, I suggest amending this by adding an "Edit on GitHub" link at the bottom of a page instead, as is custom with a fair few other static site generator packages and other documentation generators alike. |
Good catch. Tho we should switch this up completely and just have a If we want to keep an "Edit this page" in the default theme, then that control should be in the page area not the nav bar area. |
</li> | ||
{%- endif %} | ||
{%- endblock %} | ||
{%- block next_prev %}{%- endblock %} | ||
|
||
{%- block repo %} | ||
{%- if page and page.edit_url %} | ||
<li class="nav-item"> | ||
<a href="{{ page.edit_url }}" class="nav-link"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<a href="{{ page.edit_url }}" class="nav-link"> | |
<a href="{{ config.repo_url }}" class="nav-link"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I think that both the edit_url
and next_prev
can go the page/content footer. That's how other generators mostly place them by default (and some inhouse boutique docs stacks too) and consumers are likely to be looking for them down there (or, basically acting as a CTA after finishing reading the current page — prev, next, or edit if needs updating).
Good call to have the repo icon in header only link to the repo_url
to avoid any confusion (edit links render as 404 for logged-out users etc.), again pretty much a pattern nowadays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PS: watch out for the {%- if page and page.edit_url %}
condition right above if switching away from page.edit_url here…
{%- elif config.repo_name == 'GitLab' -%} | ||
<i class="fa-brands fa-gitlab"></i> {% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %} | ||
<i class="fa-brands fa-gitlab"></i><span class="d-lg-none ms-2">{% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<i class="fa-brands fa-gitlab"></i><span class="d-lg-none ms-2">{% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</span> | |
<i class="fa-brands fa-gitlab"></i><span class="d-lg-none ms-2">{{ config.repo_name }}</span> |
{%- elif config.repo_name == 'Bitbucket' -%} | ||
<i class="fa-brands fa-bitbucket"></i> {% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %} | ||
<i class="fa-brands fa-bitbucket"></i><span class="d-lg-none ms-2">{% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<i class="fa-brands fa-bitbucket"></i><span class="d-lg-none ms-2">{% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</span> | |
<i class="fa-brands fa-bitbucket"></i><span class="d-lg-none ms-2">{{ config.repo_name }}</span> |
|
||
{%- block repo %} | ||
{%- if page and page.edit_url %} | ||
<li class="nav-item"> | ||
<a href="{{ page.edit_url }}" class="nav-link"> | ||
{%- if config.repo_name == 'GitHub' -%} | ||
<i class="fa-brands fa-github"></i> {% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %} | ||
<i class="fa-brands fa-github"></i><span class="d-lg-none ms-2">{% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<i class="fa-brands fa-github"></i><span class="d-lg-none ms-2">{% trans repo_name=config.repo_name %}Edit on {{ repo_name }}{% endtrans %}</span> | ||
<i class="fa-brands fa-github"></i><span class="d-lg-none ms-2">{{ config.repo_name }}</span> |
{%- elif config.repo_name -%} | ||
{% trans repo_name=config.repo_name%}Edit on {{ repo_name }}{% endtrans %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{%- elif config.repo_name -%} | |
{% trans repo_name=config.repo_name%}Edit on {{ repo_name }}{% endtrans %} | |
{%- elif config.repo_name -%} | |
{{ config.repo_name }} |
Other docs packages often have edit buttons in the page area (indeed), and have it optional or to be enabled manually. I think that's a solid option, and agree it should be a page area element. In that sense (and I don't mean this snarkily), a navigation bar is for navigation. Anything not navigation or locating of pages like a navigation is possibly better off in the footer or page content. |
I think these are good choice, as it would make the navbar lighter ...except for the "search". Searching is so crucial that it deserves to be clearly visible IMHO, including the "Search" label, not only the small icon. The prev/next/edit indeed better belong to the page than the navbar. |
You're absolutely right to remark this. The "Search" text besides and in line with the magnifying glass icon is paramount to the function and form of a search feature and the search box. Why?
|
Refs #3680
next
/prev
controls.search
&repo
controls, except in expanded menu.expanded menu