Open chcorbato opened 1 year ago
So, I was checking how to do this and we can modify the masthead.html to something similar to the nav_list like this:
<li class="masthead__menu-item masthead__menu-item--lg"><a href="{{ base_path }}/">{{ site.title }}</a></li> {% for link in site.data.navigation.main %} {% if link.url contains 'http' %} {% assign domain = '' %} {% else %} {% assign domain = base_path %} {% endif %} <li class="masthead__menu-item"><a href="{{ domain }}{{ link.url }}">{{ link.title }}</a> {% if link.children != null %} <ul> {% for child in link.children %} {% if child.url contains 'http' %} {% assign domain = '' %} {% else %} {% assign domain = base_path %} {% endif %} {% comment %}set "active" class on current page{% endcomment %} {% if child.url == page.url %} {% assign active = "active" %} {% else %} {% assign active = "" %} {% endif %} <li><a href="{{ domain }}{{ child.url }}" class="masthead__menu-item">{{ child.title }}</a></li> {% endfor %} </ul> {% endif %} </li> {% endfor %} </ul>
And just add entries to the navigation.yml like this:
# main links links main: - title: "Parent Link 1" url: /parent-1-page-url/ children: - title: "Child Link 1" url: /child-1-page-url/ - title: "Child Link 2" url: /child-2-page-url/ - title: "Research" url: /research/ children: "Education" - title: "Education" url: /education/ - title: "Software" url: /software/ - title: "Team" url: /team/ - title: "Join us" url: /join-us/
The only problem is adjusting the html/css to make it look good, for now it looks like this:
This is in the nav_sub branch
Sounds like we cannot have it with a good enough look. I suggest we do not implement it for the moment. I label it as an enhancement and remove it form the requirements frmo the MVP
So, I was checking how to do this and we can modify the masthead.html to something similar to the nav_list like this:
And just add entries to the navigation.yml like this:
The only problem is adjusting the html/css to make it look good, for now it looks like this: