diff options
author | Justin Mayer <entroP@gmail.com> | 2013-09-09 02:25:36 -0700 |
---|---|---|
committer | Justin Mayer <entroP@gmail.com> | 2013-09-09 02:25:36 -0700 |
commit | b048e0757c82bd321a3bc2c1e9a7cfd4b9cb30bb (patch) | |
tree | e770759ce01602d140427aa9bdf5ab21e992885c | |
parent | 9c463fb6f23ca11a58364ee0df6fed9c523418d2 (diff) | |
parent | 21588b23faa7981136e01ec80b280dc2223f71e8 (diff) | |
download | pelican-themes-b048e0757c82bd321a3bc2c1e9a7cfd4b9cb30bb.tar.gz |
Merge pull request #133 from sylvain-garancher/master
Add language management for tuxlite_tbs theme
-rw-r--r-- | tuxlite_tbs/templates/base.html | 2 | ||||
-rw-r--r-- | tuxlite_tbs/templates/metadata.html | 6 | ||||
-rw-r--r-- | tuxlite_tbs/templates/page.html | 10 |
3 files changed, 16 insertions, 2 deletions
diff --git a/tuxlite_tbs/templates/base.html b/tuxlite_tbs/templates/base.html index 2c18586..4dd1f52 100644 --- a/tuxlite_tbs/templates/base.html +++ b/tuxlite_tbs/templates/base.html @@ -1,5 +1,5 @@ <!DOCTYPE html> -<html lang="en"> +<html lang="{{ DEFAULT_LANG }}"> <head> <meta charset="utf-8"> <title>{% block windowtitle %}{{ SITENAME }}{% endblock %}</title> diff --git a/tuxlite_tbs/templates/metadata.html b/tuxlite_tbs/templates/metadata.html index 3f7e987..1ee8b86 100644 --- a/tuxlite_tbs/templates/metadata.html +++ b/tuxlite_tbs/templates/metadata.html @@ -2,6 +2,12 @@ {% if article.author %} by <a class="url fn" href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a> + {% if article.translations %} + <a href="{{ SITEURL }}/{{ article.url }}" class="btn btn-info xsmall">{{ article.lang or DEFAULT_LANG }}</a> + {% for translation in article.translations %} + <a href="{{ SITEURL }}/{{ translation.url }}" class="btn btn-info xsmall">{{ translation.lang }}</a> + {% endfor %} + {% endif %} {% endif %} {# Filed under <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a> #} diff --git a/tuxlite_tbs/templates/page.html b/tuxlite_tbs/templates/page.html index 65470ea..df15a33 100644 --- a/tuxlite_tbs/templates/page.html +++ b/tuxlite_tbs/templates/page.html @@ -2,7 +2,15 @@ {% block title %} {% endblock %} {% block content %} <section id="content" class="body"> - <h2 class="content-title">{{ page.title }}</h2> + <h2 class="content-title"> + {{ page.title }} + {% if page.translations %} + <a href="{{ SITEURL }}/{{ page.url }}" class="btn btn-info xsmall">{{ page.lang or DEFAULT_LANG }}</a> + {% for translation in page.translations %} + <a href="{{ SITEURL }}/{{ translation.url }}" class="btn btn-info xsmall">{{ translation.lang }}</a> + {% endfor %} + {% endif %} + </h2> {% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ page.slug }}.pdf">get the pdf</a>{% endif %} {{ page.content }} |