about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHuy-Ngo <duchuy29092000@gmail.com>2021-01-12 12:57:04 +0700
committerHuy-Ngo <duchuy29092000@gmail.com>2021-01-12 12:57:04 +0700
commitdc1f56397374e9cf03b92d0c436f3c0e3080879f (patch)
tree6a104ec03e276907eddc742ac63295bd60e72610
parent1680076b36a580623164d9e63e2e8c2da951f270 (diff)
downloadblog-dc1f56397374e9cf03b92d0c436f3c0e3080879f.tar.gz
Remove current language and show text in appropriate language
-rw-r--r--_config.yml14
-rw-r--r--_layouts/post.html9
2 files changed, 20 insertions, 3 deletions
diff --git a/_config.yml b/_config.yml
index 432213d..bc3172d 100644
--- a/_config.yml
+++ b/_config.yml
@@ -40,7 +40,6 @@ minima:
         instance: fosstodon.org
     github:  Huy-Ngo
     twitter: false
-show_excerpts: true
 plugins:
   - jekyll-feed
 
@@ -77,11 +76,22 @@ defaults:
          path: ""
      values:
          lang: en
+         link-str: English
+         available: This post is also available in
          base-url: "/"
     -
      scope:
          path: fr
      values:
          lang: fr
+         link-str: français
+         available: Ce post est aussi disponible en
          base-url: "/fr/"
-
+    -
+     scope:
+         path: de
+     values:
+         lang: de
+         link-str: Deutsch
+         available: Diese Artikel ist auch verfügbar auf
+         base-url: "/de/"
diff --git a/_layouts/post.html b/_layouts/post.html
index 4b7e5a6..e387299 100644
--- a/_layouts/post.html
+++ b/_layouts/post.html
@@ -33,10 +33,17 @@ layout: default
       {%- endif -%}</p>
   </header>
 
+  {{ page.available }}:
   <div class="lang">
     <ul>
       {% for post in postsTrans %}
-      <li><a class="{{ post.lang }}" href="{{ site.base-url }}{{ post.url }}">{{ post.lang }}</a></li>
+      {% if post.lang != page.lang %}
+      <li>
+        <a class="{{ post.lang }}" href="{{ site.base-url }}{{ post.url }}">
+          {{ post.link-str }}
+        </a>
+      </li>
+      {% endif %}
       {% endfor %}
     </ul>
   </div>