Skip to content
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

Update navbar for new SunPy Project section #96

Merged
merged 1 commit into from
Jan 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 31 additions & 21 deletions sunpy_sphinx_theme/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,41 @@ def page_url(page):

html_sidebars = {"**": ["docsidebar.html"]}
html_theme_options = {
"about_links": [
("Our Mission", page_url("about.html"), 1),
(
"Acknowledge SunPy",
page_url("about.html") + "#acknowledging-or-citing-sunpy",
1,
),
("Code of Conduct", "https://docs.sunpy.org/en/latest/code_of_conduct.html", 1),
],
"navbar_links": [
("About", [
("Our Mission", page_url("about.html"), 1),
(
"Acknowledge SunPy",
page_url("about.html") + "#acknowledging-or-citing-sunpy",
1,
),
("Code of Conduct", "https://docs.sunpy.org/en/latest/code_of_conduct.html", 1)],
1
),
("Documentation",
[
("SunPy", "https://docs.sunpy.org/en/stable/", 1),
("ndcube", "https://docs.sunpy.org/projects/ndcube", 1),
("drms", "https://docs.sunpy.org/projects/drms", 1),
(
"radiospectra",
"https://docs.sunpy.org/projects/radiospectra/en/latest/index.html",
1,
),
("IRISPy", "https://docs.sunpy.org/projects/irispy/en/latest/", 1),
],
1
),
("Blog", page_url("blog.html"), 1),
("Support Us", page_url("contribute.html"), 1),
("Get Help", page_url("help.html"), 1),
("SunPy Project", page_url("team.html"), 1),
],
"navbar_docs": [
("SunPy", "https://docs.sunpy.org/en/stable/", 1),
("ndcube", "https://docs.sunpy.org/projects/ndcube", 1),
("drms", "https://docs.sunpy.org/projects/drms", 1),
(
"radiospectra",
"https://docs.sunpy.org/projects/radiospectra/en/latest/index.html",
1,
),
("IRISPy", "https://docs.sunpy.org/projects/irispy/en/latest/", 1),
("SunPy Project", [
("SunPy Project", page_url("project/"), 1),
("Community Roles", page_url("project/roles.html"), 1),
("Affiliated Packages", page_url("project/affiliated.html"), 1)
],
1,
),
],
# Only really setup to look nice with 3 values.
"footer_links": [
Expand Down
34 changes: 12 additions & 22 deletions sunpy_sphinx_theme/sunpy/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,21 @@

<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav navbar-left">
{% if theme_about_links %}
<li class="dropdown">
<a role="button" data-toggle="dropdown" data-target="#" href="#" }}>About<b class="caret"></b></a>
<ul class="dropdown-menu">
{%- for link in theme_about_links %}
<li class="dropdown-submenu">
<a href="{{ pathto(*link[1:]) }}">{{ link[0] }}</a></li>
{%- endfor %}
</ul>
</li>
{% endif %}
{% if theme_navbar_docs %}
{% if theme_navbar_links %}
{%- for navlink in theme_navbar_links %}
{% if navlink[1] is not string %}
<li class="dropdown">
<a role="button" data-toggle="dropdown" data-target="" href="">Documentation<b class="caret"></b></a>
<ul class="dropdown-menu">
{%- for link in theme_navbar_docs %}
<li class="dropdown-submenu">
<a href="{{ pathto(*link[1:]) }}">{{ link[0] }}</a></li>
{%- endfor %}
</ul>
<a role="button" data-toggle="dropdown" data-target="" href="">{{ navlink[0] }}<b class="caret"></b></a>
<ul class="dropdown-menu">
{%- for link in navlink[1] %}
<li class="dropdown-submenu">
<a href="{{ pathto(*link[1:]) }}">{{ link[0] }}</a></li>
{%- endfor %}
</ul>
</li>
{% else %}
<li><a href="{{ pathto(*navlink[1:]) }}">{{ navlink[0] }}</a></li>
{% endif %}
{% if theme_navbar_links %}
{%- for link in theme_navbar_links %}
<li><a href="{{ pathto(*link[1:]) }}">{{ link[0] }}</a></li>
{%- endfor %}
{% endif %}
</ul>
Expand Down