From 25707bb8a49c2e6c679db689550def254f0f4d4b Mon Sep 17 00:00:00 2001 From: Holger Reinhardt Date: Mon, 4 Jan 2016 21:49:37 +0100 Subject: [PATCH] wip --- _layouts/blog_by_category.html | 37 ---------------- _layouts/post_by_category.html | 44 +++++++++++++++++++ .../{blog_by_tag.html => post_by_tag.html} | 0 meta/category/general.md | 4 +- 4 files changed, 47 insertions(+), 38 deletions(-) delete mode 100644 _layouts/blog_by_category.html create mode 100644 _layouts/post_by_category.html rename _layouts/{blog_by_tag.html => post_by_tag.html} (100%) diff --git a/_layouts/blog_by_category.html b/_layouts/blog_by_category.html deleted file mode 100644 index 3da3280..0000000 --- a/_layouts/blog_by_category.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -layout: default ---- - -
-

{{ page.category }}

-

Articles by category

-
- -
- {% if site.categories[page.category] %} - {% for post in site.categories[page.category] %} - {% capture post_year %}{{ post.date | date: '%Y' }}{% endcapture %} - {% if forloop.first %} -

{{ post_year }}

- {% endif %} - - {% if forloop.first == false %} - {% assign previous_index = forloop.index0 | minus: 1 %} - {% capture previous_post_year %}{{ site.categories[page.category][previous_index].date | date: '%Y' }}{% endcapture %} - {% if post_year != previous_post_year %} -

{{ post_year }}

- {% endif %} - {% endif %} - - -

{{ post.title }}

-
- - {% if forloop.last %} -
- {% endif %} - {% endfor %} - {% else %} -

There are no posts in this category.

- {% endif %} -
\ No newline at end of file diff --git a/_layouts/post_by_category.html b/_layouts/post_by_category.html new file mode 100644 index 0000000..5ea5564 --- /dev/null +++ b/_layouts/post_by_category.html @@ -0,0 +1,44 @@ +--- +layout: default +--- + +
+

{{site.data.categories[page.category].name}}

+ +

+ Articles by category +

+ +
+ +
+ {% if site.categories[page.category] %} + {% for post in site.categories[page.category] %} + {% capture post_year %}{{ post.date | date: '%Y' }}{% endcapture %} + {% if forloop.first %} +

{{ post_year }}

    + {% endif %} + + {% if forloop.first == false %} + {% assign previous_index = forloop.index0 | minus: 1 %} + {% capture previous_post_year %}{{ site.categories[page.category][previous_index].date | date: '%Y' }}{% endcapture %} + {% if post_year != previous_post_year %} +

{{ post_year }}

+ {% endif %} + {% endfor %} + {% else %} +

There are no posts in this category.

+ {% endif %} + +
\ No newline at end of file diff --git a/_layouts/blog_by_tag.html b/_layouts/post_by_tag.html similarity index 100% rename from _layouts/blog_by_tag.html rename to _layouts/post_by_tag.html diff --git a/meta/category/general.md b/meta/category/general.md index 59f8b56..01314d9 100644 --- a/meta/category/general.md +++ b/meta/category/general.md @@ -1,6 +1,8 @@ --- -layout: blog_by_category +layout: page title: 'Articles by category: general' category: general permalink: /meta/category/general/ --- + +## foobar \ No newline at end of file