llighter / yunha-ind

YUNHA INDUSTRY website
https://llighter.github.io
MIT License
1 stars 0 forks source link

Implement: Active Link #6

Closed llighter closed 4 years ago

llighter commented 4 years ago

EXAMPLE: NAVIGATION LINKS WITH AN active CLASS ADDED FOR ON THE CURRENT PAGE

<ul>
{%- for post in collections.post -%}
  <li{% if page.url == post.url %} class="active"{% endif %}>{{ post.data.title }}</li>
{%- endfor -%}
</ul>

Implement in conjunction with navigation.

llighter commented 4 years ago

I think Material Tab bar is too much for me. It could be better using plane nav-bar to build Bottom Border Nav Links Here's an Example.

llighter commented 4 years ago

This is an simple example referred from eleventy-base-blog

<header>
   <h1 class="home"><a href="{{ '/' | url }}">{{ metadata.title }}</a></h1>
   <ul class="nav">
     {%- for nav in collections.nav | reverse -%}
     <li class="nav-item{% if nav.url == page.url %} nav-item-active{% endif %}"><a href="{{ nav.url | url }}">{{ nav.data.navtitle }}</a></li>
     {%- endfor -%}
   </ul>
</header>
llighter commented 4 years ago

Instead of explicity writing, I can use collection tag, nav. So I can use collection of nav.

Before applying this change, I have to check nav object. So that I can see what's inside.

Also, I should remove the style applied to the a tag.