Skip to content

Instantly share code, notes, and snippets.

@kemingy
Created August 3, 2018 03:50
Show Gist options
  • Select an option

  • Save kemingy/362c625790d10e419ec94a4521dfb51d to your computer and use it in GitHub Desktop.

Select an option

Save kemingy/362c625790d10e419ec94a4521dfb51d to your computer and use it in GitHub Desktop.
Category archive example with jekyll-archives
{%- for page in site.archives -%}
{%- if page.type == 'category' -%}
<h2>{{ page.title }}</h2>
<ul class="posts">
{%- assign date_format = site.date_format | default: "%b %-d, %Y" -%}
{%- for post in page.posts -%}
<li>
<span class="post-date">{{ post.date | date: date_format }}</span>
<a href="{{ post.url | relative_url }}" class="post-link">{{ post.title }}</a>
</li>
{%- endfor -%}
</ul>
{%- endif -%}
{%- endfor -%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment