Skip to content

Commit

Permalink
add submenus for collections
Browse files Browse the repository at this point in the history
  • Loading branch information
gherardovarando committed Mar 20, 2024
1 parent 20fc907 commit bef4701
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 8 deletions.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ timezone: Europe/Madrid
##
future: true
collections:
events:
output: true
menu: true
sort_by: date
talks:
output: true
news:
Expand Down
12 changes: 12 additions & 0 deletions _events/workshop1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: default
title: An amazing workshop
location: virtual
date: 2020-07-24 14:00 +03:00
location: virtual
link: https://www.youtube.com/
published: true
---

An amazing workshop!!

12 changes: 12 additions & 0 deletions _events/workshop2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: default
title: An amazing workshop 2
location: virtual
date: 2022-07-24 14:00 +03:00
location: virtual
link: https://www.youtube.com/
published: true
---

An amazing workshop!!

29 changes: 23 additions & 6 deletions _includes/topmenu.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
<nav class="topnav" id="topnav">
{% assign pages = site.pages | sort: "weight" %}
{% for pg in pages %}{% if pg.title %}{% unless pg.hide %}
<a {% if pg.url == page.url %} class = "active" ,{% endif %} href="{{ pg.url | relative_url }}">{{ pg.title }}</a>
{% endunless %}{% endif %}
{% endfor %}

{% assign collections = site.collections | where_exp: "item", "item.menu" %}
{% assign pages = site.pages | sort: "weight" %}
{% for pg in pages %}
{% if pg.title %}{% unless pg.hide %}
<a {% if pg.url == page.url %} class = "active" ,{% endif %} href="{{ pg.url | relative_url }}">{{ pg.title }}</a>
{% endunless %}{% endif %}
{% endfor %}
{% for cl in collections %}
<div class="top-button">
{% if cl.menu_label %}
{{ cl.menu_label }}
{% else %}
{{ cl.label }}
{% endif %}
<nav class="subnav">
{% for pg in cl.docs %}
{% if pg.title %}{% unless pg.hide %}
<a {% if pg.url == page.url %} class = "active" ,{% endif %} href="{{ pg.url | relative_url }}">{{ pg.title }}</a>
{% endunless %}{% endif %}
{% endfor %}
</nav>
</div>
{% endfor %}
<div class="plinks">
{% for link in site.links %}
<a class = "plink" href = "{{ link.url }}">{{ link.name }}</a>
Expand Down
29 changes: 27 additions & 2 deletions assets/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ div.title {


/* Style the links inside the navigation bar */
.topnav a {
.topnav a, .topnav div.top-button {
display: block;
float: left;
color: #d9dbda;
text-align: center;
Expand All @@ -117,6 +118,11 @@ div.title {

/* Change the color of links on hover */
.topnav a:hover {
background-color: #729FCF;
color: black;
}

.topnav div.top-button:hover {
background-color: #268BD2;
color: black;
}
Expand All @@ -143,13 +149,32 @@ div.title {
color: white;
}


.subnav {
display: none;
position: fixed;
left: 0;
width: 100%;
height: auto;
z-index: 1;
background-color: #268BD2;
color: black;
}



.topnav div:hover .subnav {
display: block;
}


.topnav .menubutton {
display: none;
}


div.bibtexout {
background: #f4f4f4;
background: #f4f4f4;
border: 1px solid #ddd;
border-left: 3px solid #268BD2;
color: #666;
Expand Down

0 comments on commit bef4701

Please sign in to comment.