From 18d47b6dfd2946ffb2e84de563b1a6b6397829fc Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Mon, 28 Aug 2017 15:06:49 +0200 Subject: News module now lists only news in pages language. --- blog/_config.yml | 16 ++++++++++++++++ blog/_includes/news.html | 3 ++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/blog/_config.yml b/blog/_config.yml index 0f28770..42aa156 100644 --- a/blog/_config.yml +++ b/blog/_config.yml @@ -24,6 +24,16 @@ collections: future: true defaults: + - + scope: + path: "" + values: + lang: "no" + - + scope: + path: "en" + values: + lang: "en" - scope: path: "" @@ -31,6 +41,12 @@ defaults: values: layout: "post" author: "Harald" + - + scope: + path: "_posts/en" + type: "posts" + values: + lang: "en" - scope: path: "_concerts" diff --git a/blog/_includes/news.html b/blog/_includes/news.html index f7b893d..d08c45f 100644 --- a/blog/_includes/news.html +++ b/blog/_includes/news.html @@ -1,6 +1,7 @@

Nyheter

- {% for p in site.posts limit: 5 %} + {% assign posts_for_lang = site.posts | where_exp: "p","p.lang == page.lang" %} + {% for p in posts_for_lang limit: 5 %} {% if p != page %} {% if include.sidebar %} {% include post-excerpt.html post=p sidebar=true %} -- cgit v1.2.3