Add posts, categories, category, tags, tag, and collection layouts
Replace sample pages with hard coded HTML and Liquid in favor of a layout that does all the heavy lifting. Assign the appropriate `layout` via YAML Front Matter and away you go.
This commit is contained in:
19
_includes/documents-collection.html
Normal file
19
_includes/documents-collection.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% assign entries = site[include.collection] %}
|
||||
|
||||
{% if include.sort_by == 'title' %}
|
||||
{% if include.sort_order == 'reverse' %}
|
||||
{% assign entries = entries | sort: 'title' | reverse %}
|
||||
{% else %}
|
||||
{% assign entries = entries | sort: 'title' %}
|
||||
{% endif %}
|
||||
{% elsif include.sort_by == 'date' %}
|
||||
{% if include.sort_order == 'reverse' %}
|
||||
{% assign entries = entries | sort: 'date' | reverse %}
|
||||
{% else %}
|
||||
{% assign entries = entries | sort: 'date' %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{%- for post in entries -%}
|
||||
{% include archive-single.html %}
|
||||
{%- endfor -%}
|
3
_includes/posts-category.html
Normal file
3
_includes/posts-category.html
Normal file
@ -0,0 +1,3 @@
|
||||
{%- for post in site.categories[include.taxonomy] -%}
|
||||
{% include archive-single.html %}
|
||||
{%- endfor -%}
|
3
_includes/posts-tag.html
Normal file
3
_includes/posts-tag.html
Normal file
@ -0,0 +1,3 @@
|
||||
{%- for post in site.tags[include.taxonomy] -%}
|
||||
{% include archive-single.html %}
|
||||
{%- endfor -%}
|
Reference in New Issue
Block a user