From ed468ee4d481865a6325e601168c6b78940c322a Mon Sep 17 00:00:00 2001 From: Tunghsiao Liu Date: Wed, 26 Aug 2015 14:09:43 +0800 Subject: [PATCH] fix(template): missing post language tag --- _app/_includes/_amsf.html | 10 ++-- .../themes/curtana/includes/page-item.html | 56 +++++++++++-------- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/_app/_includes/_amsf.html b/_app/_includes/_amsf.html index bf40aa4f3..b45e06215 100644 --- a/_app/_includes/_amsf.html +++ b/_app/_includes/_amsf.html @@ -92,10 +92,12 @@ Page language tag {% endcomment %} {% capture amsf_page_lang %} - {% if page.languages and page.languages[0] != null %} - lang="{{ page.languages | first }}" - {% else %} - lang="{{ page.languages }}" + {% if page.languages %} + {% if page.languages[0] != null %} + lang="{{ page.languages | first }}" + {% else %} + lang="{{ page.languages }}" + {% endif %} {% endif %} {% endcapture %} diff --git a/_app/_includes/themes/curtana/includes/page-item.html b/_app/_includes/themes/curtana/includes/page-item.html index 8d33e8bf9..e73291940 100644 --- a/_app/_includes/themes/curtana/includes/page-item.html +++ b/_app/_includes/themes/curtana/includes/page-item.html @@ -1,28 +1,40 @@ -
-

- - {% capture post_link_color %} - {% if post.scheme-bg %} - {% if post.scheme-bg-light %} - style="color: {{ post.scheme-text }};" - {% else %} - style="color: {{ post.scheme-bg }};" - {% endif %} - {% endif %} - {% endcapture %} - - {% capture post_link_bg %} - {% if post.scheme-bg %} - {% if post.scheme-bg-light %} - style="background: {{ post.scheme-text }};" - {% else %} - style="background: {{ post.scheme-bg }};" - {% endif %} - {% endif %} - {% endcapture %} + +{% capture amsf_post_lang %} + {% if post.languages %} + {% if post.languages[0] != null %} + lang="{{ post.languages | first }}" + {% else %} + lang="{{ post.languages }}" + {% endif %} + {% endif %} +{% endcapture %} + + +{% capture post_link_color %} + {% if post.scheme-bg %} + {% if post.scheme-bg-light %} + style="color: {{ post.scheme-text }};" + {% else %} + style="color: {{ post.scheme-bg }};" + {% endif %} + {% endif %} +{% endcapture %} + +{% capture post_link_bg %} + {% if post.scheme-bg %} + {% if post.scheme-bg-light %} + style="background: {{ post.scheme-text }};" + {% else %} + style="background: {{ post.scheme-bg }};" + {% endif %} + {% endif %} +{% endcapture %} + +
+

{{ post.title }}