-
-
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
Changes from all commits
01394aa
acdcdb6
292bc68
1d729f0
d295dd4
4bf62f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -114,37 +114,24 @@ | |||||||||
{%- if 'search' in config.plugins %} | ||||||||||
<li class="nav-item"> | ||||||||||
<a href="#" class="nav-link" data-bs-toggle="modal" data-bs-target="#mkdocs_search_modal"> | ||||||||||
<i class="fa fa-search"></i> {% trans %}Search{% endtrans %} | ||||||||||
<i class="fa fa-search"></i><span class="d-lg-none ms-2">Search</span> | ||||||||||
</a> | ||||||||||
</li> | ||||||||||
{%- endif %} | ||||||||||
{%- endblock %} | ||||||||||
|
||||||||||
{%- block next_prev %} | ||||||||||
{%- if page and (page.next_page or page.previous_page) %} | ||||||||||
<li class="nav-item"> | ||||||||||
<a rel="prev" {% if page.previous_page %}href="{{ page.previous_page.url|url }}" class="nav-link"{% else %}class="nav-link disabled"{% endif %}> | ||||||||||
<i class="fa fa-arrow-left"></i> {% trans %}Previous{% endtrans %} | ||||||||||
</a> | ||||||||||
</li> | ||||||||||
<li class="nav-item"> | ||||||||||
<a rel="next" {% if page.next_page %}href="{{ page.next_page.url|url }}" class="nav-link"{% else %}class="nav-link disabled"{% endif %}> | ||||||||||
{% trans %}Next{% endtrans %} <i class="fa fa-arrow-right"></i> | ||||||||||
</a> | ||||||||||
</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"> | ||||||||||
{%- 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
{%- 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
{%- 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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
{%- elif config.repo_name -%} | ||||||||||
{% trans repo_name=config.repo_name%}Edit on {{ repo_name }}{% endtrans %} | ||||||||||
Comment on lines
135
to
136
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
{% else %} | ||||||||||
|
@@ -171,8 +158,7 @@ | |||||||||
{%- if config.theme.user_color_mode_toggle %} | ||||||||||
<li class="nav-item dropdown"> | ||||||||||
<button id="theme-menu" aria-expanded="false" data-bs-toggle="dropdown" data-bs-display="static" aria-label="Toggle theme" class="nav-link dropdown-toggle"> | ||||||||||
<i class="fa-solid fa-circle-half-stroke fa-fw"></i> | ||||||||||
<span class="d-lg-none ms-2">Toggle theme</span> | ||||||||||
<i class="fa-solid fa-circle-half-stroke fa-fw"></i><span class="d-lg-none ms-2">Toggle theme</span> | ||||||||||
</button> | ||||||||||
<ul class="dropdown-menu dropdown-menu-end"> | ||||||||||
<li> | ||||||||||
|
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.
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
andnext_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…