_includes/header.html in hardpool-flat-0.1.0 vs _includes/header.html in hardpool-flat-1.0.0

- old
+ new

@@ -1,17 +1,51 @@ -{% capture logo_path %}{{ site.main_logo }}{% endcapture %} - -<header> +{% assign logo_path = site.main_logo %} +<header class="style-default"> <div class="container text-center"> <div class="row"> <div class="col"> - <a class="main-logo mt-6" href="{{ '/' | relative_url }}"><img src="{{ logo_path | relative_url }}" alt=" "></a> + <a class="main-logo mt-5" href="{{ '/' | relative_url }}"><img src="{{ logo_path | relative_url }}" alt=" "></a> </div> </div> <div class="row"> <div class="col"> - <h1 class="mt-3">{{ site.title }}</h1> + <h1 class="mt-3 mb-0">{{ site.name }}</h1> <p class="text-info text-lg">{{ site.description }}</p> </div> </div> + <ul class="nav d-flex justify-content-center mb-5"> + {%- for link in site.data.navigation.main -%} + {%- if link.url contains '://' -%} + {%- assign url = link.url -%} + {%- else -%} + {%- assign url = link.url | relative_url -%} + {%- endif -%} + <!-- {{ page.url }} --> + <li class="nav-item"> + <a class="nav-link {% if page.url==url %}active{% endif %}" href="{{ url }}">{{ link.title }}</a> + </li> + {%- endfor -%} + <!-- show collection navigation --> + {% for collection in site.collections %} + {% if collection.navigation %} + <li class="nav-item"> + <a class="nav-link {% if page.url==url %}active{% endif %}" href="/{{ collection.relative_directory | remove_first: '_' }}">{{ collection.label | capitalize }}</a> + </li> + <!-- create categories array--> + {% assign categories_col = "" | split:"|" %} + <!--Add each unique 'my_collection' category to the array--> + {% for post in collection.docs %} + {% for category in post.categories %} + {% assign categories_col = categories_col | push: category | uniq %} + {% endfor %} + {% endfor %} + <!-- show category navigation --> + {% for cat in categories_col %} + <li class="nav-item"> + <a class="nav-link {% if page.url==url %}active{% endif %}" href="/{{ collection.relative_directory | remove_first: '_' }}/{{ cat }}">{{ cat | capitalize }}</a> + </li> + {% endfor %} + {% endif %} + {% endfor %} + </ul> </div> </header> \ No newline at end of file