Converting nav to supporting category pages.
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
{%- if my_page.title -%}
|
||||
{%- if my_page.url == page.url -%}
|
||||
<li><a class="active" href="#top">{{ my_page.title }}</a></li>
|
||||
{%- elsif page.url contains my_page.url and my_page.url != "/" -%}
|
||||
<li><a class="active" href="{{ my_page.url | relative_url }}">{{ my_page.title }}</a></li>
|
||||
{%- else -%}
|
||||
<li><a href="{{ my_page.url | relative_url }}">{{ my_page.title }}</a></li>
|
||||
{%- endif -%}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
{%- for category in site.categories -%}
|
||||
{%- if category[0] != page.category -%}
|
||||
{%- continue -%}
|
||||
{%- endif -%}
|
||||
|
||||
{%- assign posts = category[1] -%}
|
||||
|
||||
{%- if posts.size > 0 -%}
|
||||
<section id="articles" class="">
|
||||
<div class="container">
|
||||
{%- if page.list_title -%}
|
||||
<h3>{{ page.list_title | capitalize }}</h3>
|
||||
{%- endif -%}
|
||||
<div class="features">
|
||||
{%- assign date_format = site.date_format | default: "%b %-d, %Y" -%}
|
||||
{%- for post in posts -%}
|
||||
<article>
|
||||
<a href="{{ post.url | relative_url }}" class="image">
|
||||
<img src="{{ post.banner }}" alt="">
|
||||
</a>
|
||||
<div class="inner">
|
||||
<h4><a href="{{ post.url | relative_url }}">{{ post.title | escape }}</a></h4>
|
||||
{{ post.date | date: date_format }}
|
||||
{%- if site.show_excerpts -%}
|
||||
{{ post.excerpt }}
|
||||
{%- endif -%}
|
||||
</div>
|
||||
</article>
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{%- endif -%}
|
||||
{%- break -%}
|
||||
{%- endfor -%}
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
layout: default
|
||||
---
|
||||
|
||||
{{ content }}
|
||||
|
||||
{% include posts.html %}
|
||||
Reference in New Issue
Block a user