-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: add icon_links option for custom navbar icons (with docs and pyp…
…i example) (#293)
- Loading branch information
Showing
11 changed files
with
155 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{%- macro icon_link_nav_item(url, icon, name) -%} | ||
{%- if url | length > 2 %} | ||
<li class="nav-item"> | ||
<a class="nav-link" href="{{ url }}" rel="noopener" target="_blank" title="{{ _(name) }}"> | ||
<span><i class="{{ icon }}"></i></span> | ||
<label class="sr-only">{{ _(name) }}</label> | ||
</a> | ||
</li> | ||
{%- endif -%} | ||
{%- endmacro -%} | ||
|
||
<ul id="navbar-icon-links" class="navbar-nav" aria-label="{{ _(theme_icon_links_label) }}"> | ||
{%- block icon_link_shortcuts -%} | ||
{{ icon_link_nav_item(theme_github_url, "fab fa-github-square", "GitHub") -}} | ||
{{ icon_link_nav_item(theme_gitlab_url, "fab fa-gitlab", "GitLab") -}} | ||
{{ icon_link_nav_item(theme_twitter_url, "fab fa-twitter-square", "Twitter") -}} | ||
{% endblock -%} | ||
{%- for icon_link in theme_icon_links -%} | ||
{{ icon_link_nav_item(icon_link["url"], icon_link["icon"], icon_link["name"]) -}} | ||
{%- endfor %} | ||
</ul> |
2 changes: 1 addition & 1 deletion
2
...ndex.0e366ba14472447708f75ccb7d8f24a3.css → ...ndex.4ea0a4617f49cfd39b5b9e9540ffc872.css
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<ul aria-label="Quick Links" class="navbar-nav" id="navbar-icon-links"> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="x://y/z" rel="noopener" target="_blank" title="GitHub"> | ||
<span> | ||
<i class="fab fa-github-square"> | ||
</i> | ||
</span> | ||
<label class="sr-only"> | ||
GitHub | ||
</label> | ||
</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link" href="x://y/z" rel="noopener" target="_blank" title="Xyz"> | ||
<span> | ||
<i class="fax fa-xyz"> | ||
</i> | ||
</span> | ||
<label class="sr-only"> | ||
Xyz | ||
</label> | ||
</a> | ||
</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters