From a26fed213b5f7d056d5f564194115cf2f78ac65f Mon Sep 17 00:00:00 2001 From: Sirje Siilik Date: Mon, 17 Apr 2017 14:32:06 +0300 Subject: [PATCH 1/3] Update manifest. --- manifest.json | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/manifest.json b/manifest.json index d7da312..00bd3ff 100644 --- a/manifest.json +++ b/manifest.json @@ -33,6 +33,27 @@ "layout_name": "blog_article", "title": "Blog article" }, + { + "content_type": "component", + "component": true, + "file": "components/post-box.tpl", + "layout_name": "post-box", + "title": "post-box" + }, + { + "content_type": "component", + "component": true, + "file": "components/footer.tpl", + "layout_name": "footer", + "title": "footer" + }, + { + "content_type": "component", + "component": true, + "file": "components/header.tpl", + "layout_name": "header", + "title": "header" + }, { "content_type": "component", "component": true, @@ -85,9 +106,9 @@ { "content_type": "component", "component": true, - "file": "components/post-box.tpl", - "layout_name": "post-box", - "title": "post-box" + "file": "components/comment-form.tpl", + "layout_name": "comment-form", + "title": "comment-form" }, { "content_type": "component", @@ -179,27 +200,6 @@ "file": "components/topbar.tpl", "layout_name": "topbar", "title": "topbar" - }, - { - "content_type": "component", - "component": true, - "file": "components/comment-form.tpl", - "layout_name": "comment-form", - "title": "comment-form" - }, - { - "content_type": "component", - "component": true, - "file": "components/footer.tpl", - "layout_name": "footer", - "title": "footer" - }, - { - "content_type": "component", - "component": true, - "file": "components/header.tpl", - "layout_name": "header", - "title": "header" } ], "assets": [ From e3f3dcfa605dfbe922a5611752e5cd9dc9aee6a9 Mon Sep 17 00:00:00 2001 From: Sirje Siilik Date: Mon, 17 Apr 2017 14:32:22 +0300 Subject: [PATCH 2/3] Update node modules. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4ad485a..c5dd251 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "devDependencies": { "autoprefixer": "^6.7.7", "grunt": "^1.0.1", - "grunt-contrib-clean": "^1.0.0", + "grunt-contrib-clean": "^1.1.0", "grunt-contrib-concat": "^1.0.1", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-cssmin": "^2.0.0", From 672171ff44c2bd723e3718c01a240142e861597c Mon Sep 17 00:00:00 2001 From: Sirje Siilik Date: Mon, 17 Apr 2017 14:39:30 +0300 Subject: [PATCH 3/3] Year number behind articles Issue: #52 --- components/blog-article-variables.tpl | 3 +++ components/post-box.tpl | 10 +++++++++- layouts/blog___news.tpl | 1 + layouts/blog_article.tpl | 1 + manifest.json | 7 +++++++ 5 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 components/blog-article-variables.tpl diff --git a/components/blog-article-variables.tpl b/components/blog-article-variables.tpl new file mode 100644 index 0000000..10fdf78 --- /dev/null +++ b/components/blog-article-variables.tpl @@ -0,0 +1,3 @@ +{% capture dont_render %} + {% assign current_year = "now" | date: "%Y" | to_num %} +{% endcapture %} diff --git a/components/post-box.tpl b/components/post-box.tpl index fd683c2..0c63569 100644 --- a/components/post-box.tpl +++ b/components/post-box.tpl @@ -1,7 +1,15 @@

{% if post-box == "article" %}{% editable article.title %}{% else %}{{ article.title }}{% endif %}

- + {% assign article_year = article.created_at | format_date: "%Y" | to_num %} + + {% if article_year == current_year %} + {% assign article_date_format = "long_without_year" %} + {% else %} + {% assign article_date_format = "long" %} + {% endif %} + +
diff --git a/layouts/blog___news.tpl b/layouts/blog___news.tpl index 2d85424..7f669e1 100644 --- a/layouts/blog___news.tpl +++ b/layouts/blog___news.tpl @@ -1,4 +1,5 @@ +{% include "blog-article-variables" %} {% include "template-variables" %} diff --git a/layouts/blog_article.tpl b/layouts/blog_article.tpl index 6d51969..263f23f 100644 --- a/layouts/blog_article.tpl +++ b/layouts/blog_article.tpl @@ -1,4 +1,5 @@ +{% include "blog-article-variables" %} {% assign blog_article_page = true %} diff --git a/manifest.json b/manifest.json index 00bd3ff..11c5d21 100644 --- a/manifest.json +++ b/manifest.json @@ -200,6 +200,13 @@ "file": "components/topbar.tpl", "layout_name": "topbar", "title": "topbar" + }, + { + "title": "blog-article-variables", + "layout_name": "blog-article-variables", + "content_type": "component", + "component": true, + "file": "components/blog-article-variables.tpl" } ], "assets": [