diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2017-08-28 15:06:49 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2017-08-28 15:06:49 +0200 |
commit | 18d47b6dfd2946ffb2e84de563b1a6b6397829fc (patch) | |
tree | eee49c0fa50322a0b324ac0f50aae2ebf14089d9 | |
parent | 7cacf1d169b2c86709f73976246396f83e295e8e (diff) | |
download | norsk-urskog-main-18d47b6dfd2946ffb2e84de563b1a6b6397829fc.tar.gz norsk-urskog-main-18d47b6dfd2946ffb2e84de563b1a6b6397829fc.tar.bz2 norsk-urskog-main-18d47b6dfd2946ffb2e84de563b1a6b6397829fc.zip |
News module now lists only news in pages language.
-rw-r--r-- | blog/_config.yml | 16 | ||||
-rw-r--r-- | blog/_includes/news.html | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/blog/_config.yml b/blog/_config.yml index 0f28770..42aa156 100644 --- a/blog/_config.yml +++ b/blog/_config.yml @@ -27,12 +27,28 @@ defaults: - scope: path: "" + values: + lang: "no" + - + scope: + path: "en" + values: + lang: "en" + - + scope: + path: "" type: "posts" values: layout: "post" author: "Harald" - scope: + path: "_posts/en" + type: "posts" + values: + lang: "en" + - + scope: path: "_concerts" values: layout: "concert" 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 @@ <section id="news"> <h2>Nyheter</h2> - {% 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 %} |