Skip to content

Commit da50615

Browse files
committed
INFRA: Add dropdown menus to site
1 parent 8ad799c commit da50615

File tree

5 files changed

+512
-85
lines changed

5 files changed

+512
-85
lines changed

_data/navigation.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,28 @@
11
# main links
22
main:
33
- title: "Peer Review & Packages"
4-
url: /python-packages/
4+
url:
5+
sub-nav:
6+
- title: "About peer review"
7+
icon: "fas fa-fw fa-envelope-square"
8+
url: "/about-peer-review/"
9+
- title: "Peer review guide"
10+
url: "https://www.pyopensci.org/peer-review-guide/"
11+
- title: "Python package guide"
12+
url: "https://www.pyopensci.org/python-package-guide/"
13+
- title: "Our packages"
14+
icon: "fas fa-fw fa-envelope-square"
15+
url: "/python-packages/"
516
- title: "Blog"
617
url: /blog/
7-
- title: "Resources"
8-
url: /resources/
9-
- title: "Our Community"
10-
url: /our-community/
18+
# - title: "Resources"
19+
# url: /resources/
20+
- title: "Community"
21+
sub-nav:
22+
- title: "Our Community"
23+
url: "/our-community/"
24+
- title: "Governance"
25+
icon: "fas fa-fw fa-envelope-square"
26+
url: "https://www.pyopensci.org/governance/"
1127
- title: "Contact"
1228
url: /get-involved-contact/

_includes/footer.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<div class="page__footer-follow">
2+
<ul class="social-icons">
3+
{% if site.data.ui-text[site.locale].follow_label %}
4+
<li><strong>{{ site.data.ui-text[site.locale].follow_label }}</strong></li>
5+
{% endif %}
6+
7+
{% if site.footer.links %}
8+
{% for link in site.footer.links %}
9+
{% if link.label and link.url %}
10+
<li><a href="{{ link.url }}" rel="nofollow noopener noreferrer"><i class="{{ link.icon | default: 'fas fa-link' }}" aria-hidden="true"></i> {{ link.label }}</a></li>
11+
{% endif %}
12+
{% endfor %}
13+
{% endif %}
14+
15+
{% unless site.atom_feed.hide %}
16+
<li><a href="{% if site.atom_feed.path %}{{ site.atom_feed.path }}{% else %}{{ '/feed.xml' | relative_url }}{% endif %}"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].feed_label | default: "Feed" }}</a></li>
17+
{% endunless %}
18+
</ul>
19+
</div>
20+
pyOpenSci is a fiscally sponsored project of Community Initiatives
21+
22+
<div class="page__footer-copyright">&copy; {{ site.time | date: '%Y' }} {{ site.name | default: site.title }}</div>
23+
<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
24+
<script src="/assets/js/dropdown.js"></script>

_includes/masthead.html

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{% capture logo_path %}{{ site.logo }}{% endcapture %}
2+
3+
<div class="masthead">
4+
<div class="masthead__inner-wrap">
5+
<div class="masthead__menu">
6+
<nav id="site-nav" class="nav__topbar" aria-label="Top Bar">
7+
<!-- More accessible as a screen reader will group the title and image in the same link -->
8+
{% unless logo_path == empty %}
9+
<a class="site-logo" href="{{ '/' | relative_url }}">
10+
<img src="{{ logo_path | relative_url }}" alt="Welcome to the pyOpenSci website. This is the pyOpenSci logo.">
11+
<span class="site-title">pyOpenSci</span>
12+
</a>
13+
{% endunless %}
14+
15+
<ul class="nav__links">
16+
{%- for alink in site.data.navigation.main -%}
17+
{% if alink.sub-nav %}
18+
<!-- If there is sub nav to display -->
19+
<li class="dropdown">
20+
<button class="dropbtn" tabindex="0" aria-expanded="false">{{ alink.title }} <i class="fas fa-caret-down"></i>
21+
</button>
22+
<ul class="dropdown-content">
23+
{% for subnav in alink.sub-nav %}
24+
<li>
25+
<a href="{{ subnav.url }}" class="masthead__menu-item hover-underline">{{ subnav.title }}</a>
26+
</li>
27+
{% endfor %}
28+
</ul>
29+
</li>
30+
{% else %}
31+
<li>
32+
<a href="{{ alink.url | relative_url }}" class="hover-underline">{{ alink.title }}</a>
33+
</li>
34+
{% endif %}
35+
{% endfor %}
36+
<li>
37+
38+
</li>
39+
</ul>
40+
<!--
41+
{% if site.search == true %}
42+
<button class="search__toggle" type="button">
43+
<span class="visually-hidden">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search" }}</span>
44+
<i class="fas fa-search"></i>
45+
</button>
46+
{% endif %}
47+
-->
48+
49+
<ul class="hidden-links hidden"></ul>
50+
<!-- Burger button - span class for screen readers-->
51+
<button class="hamburger__btn-toggle" type="button" count="1" aria-expanded="false">
52+
<span class="visually-hidden">Toggle top navigation menu</span> <!--screen readers-->
53+
<div class="burger__icon"></div>
54+
</button>
55+
</nav>
56+
</div>
57+
</div>
58+
</div>

0 commit comments

Comments
 (0)