Skip to content

Commit

Permalink
Fix footer display (#168)
Browse files Browse the repository at this point in the history
I did not notice before, but the recent pydata sphinx theme versions had
unset our footer. I will send a PR later to fix the 0.5.0 docs in
napari.github.io, but this fixes the immediate issues and changes the
wording on the footer items as requested in #12 .
  • Loading branch information
melissawm authored Jul 19, 2024
1 parent f58b7b0 commit 48bc641
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 43 deletions.
30 changes: 24 additions & 6 deletions napari_sphinx_theme/footer.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
<footer class="napari-footer">
{% for footer_item in theme_footer_items %}
<div class="footer-item">
{% include footer_item %}
{% if theme_footer_start or theme_footer_center or theme_footer_end %}
<div class="bd-footer__inner bd-page-width">
{% if theme_footer_start %}
<div class="footer-items__start">
{% for item in theme_footer_start %}
<div class="footer-item">{% include item %}</div>
{% endfor %}
</div>
{% endfor %}
</footer>
{% endif %}
{% if theme_footer_center %}
<div class="footer-items__center">
{% for item in theme_footer_center %}
<div class="footer-item">{% include item %}</div>
{% endfor %}
</div>
{% endif %}
{% if theme_footer_end %}
<div class="footer-items__end">
{% for item in theme_footer_end %}
<div class="footer-item">{% include item %}</div>
{% endfor %}
</div>
{% endif %}
</div>
{% endif %}
7 changes: 7 additions & 0 deletions napari_sphinx_theme/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{%- extends "pydata_sphinx_theme/layout.html" %}

{%- block footer %}
<footer class="napari-footer">
{%- include "footer.html" %}
</footer>
{%- endblock %}
22 changes: 11 additions & 11 deletions napari_sphinx_theme/napari-footer-links.html
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<a class="footer-icon__hover-blue" href="https://napari.org" target="_blank" rel="noreferrer">
<a class="footer-icon__hover-blue" href="https://napari.org" title="napari.org" target="_blank" rel="noreferrer">
{% include "partials/napari.html" %}
<span>napari</span>
</a>

<a class="footer-icon__hover-blue" href="https://napari-hub.org" target="_blank" rel="noreferrer">
<a class="footer-icon__hover-blue" href="https://napari-hub.org" title="napari hub" target="_blank" rel="noreferrer">
{% include "partials/napari-hub.html" %}
{% include "partials/napari-hub-light-blue.html" %}
<span>napari hub</span>
<span>Plugins</span>
</a>

<a class="footer-icon__hover-blue" href="https://github.com/napari/napari" target="_blank" rel="noreferrer">
<a class="footer-icon__hover-blue" href="https://github.com/napari/napari" title="GitHub" target="_blank" rel="noreferrer">
{% include "partials/github.html" %}
{% include "partials/github-light-blue.html" %}
<span>GitHub</span>
<span>Code</span>
</a>

<a class="footer-icon__hover-blue" href="https://fosstodon.org/@napari" target="_blank" rel="noreferrer">
<a class="footer-icon__hover-blue" href="https://fosstodon.org/@napari" title="Mastodon" target="_blank" rel="noreferrer">
{% include "partials/mastodon.html" %}
{% include "partials/mastodon-light-blue.html" %}
<span>Mastodon</span>
</a>

<a class="footer-icon__hover-blue" href="https://twitter.com/napari_imaging" target="_blank" rel="noreferrer">
<a class="footer-icon__hover-blue" href="https://twitter.com/napari_imaging" title="Twitter" target="_blank" rel="noreferrer">
{% include "partials/twitter.html" %}
{% include "partials/twitter-light-blue.html" %}
<span>Twitter</span>
</a>

<a class="footer-icon__hover-blue" href="https://forum.image.sc/tag/napari" target="_blank" rel="noreferrer">
<a class="footer-icon__hover-blue" href="https://forum.image.sc/tag/napari" title="image.sc" target="_blank" rel="noreferrer">
{% include "partials/image-sc.html" %}
{% include "partials/image-sc-light-blue.html" %}
<span>image.sc</span>
<span>Forum</span>
</a>

<a class="footer-icon__hover-blue" href="https://napari.zulipchat.com" target="_blank" rel="noreferrer">
<a class="footer-icon__hover-blue" href="https://napari.zulipchat.com" title="Zulip" target="_blank" rel="noreferrer">
{% include "partials/zulip.html" %}
{% include "partials/zulip-light-blue.html" %}
<span>Zulip</span>
<span>Chat</span>
</a>
23 changes: 0 additions & 23 deletions napari_sphinx_theme/napari-layout.html

This file was deleted.

19 changes: 17 additions & 2 deletions napari_sphinx_theme/static/css/napari-sphinx-theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ h1 {
align-items: center;
justify-content: space-between;
background-color: black;
padding-left: 1.5rem;
padding-right: 1.5rem;
padding-top: 1.5rem;
padding-bottom: 0.5rem;
margin-top: 75px;
Expand Down Expand Up @@ -206,6 +204,23 @@ h1 {
display: block;
}

/* Recommended by PST */
.footer-items__start, .footer-items__end {
flex-direction: row;
}

.bd-footer__inner {
display: flex;
flex-shrink: 0;
flex-direction: row;
flex-wrap: wrap;
width: 100%;
max-width: 100%;
align-items: center;
justify-content: space-between;
background-color: black;
}

/****************************
Nav bar section
*****************************/
Expand Down
6 changes: 5 additions & 1 deletion napari_sphinx_theme/theme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ navbar_align = content
navbar_start = navbar-logo.html
navbar_center = navbar-nav.html
navbar_end = navbar-icon-links.html
footer_items = napari-footer-links.html, napari-copyright.html
page_sidebar_items = page-toc.html
article_footer_items =
content_footer_items =
footer_start = napari-footer-links.html
footer_center =
footer_end = napari-copyright.html

0 comments on commit 48bc641

Please sign in to comment.