Skip to content

Instantly share code, notes, and snippets.

@Lothiraldan
Created April 6, 2011 07:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Lothiraldan/905295 to your computer and use it in GitHub Desktop.
Save Lothiraldan/905295 to your computer and use it in GitHub Desktop.
Add support for translations into notmyidea-cms theme
From 4214fc96254f373707bcd56477414096be7973ea Mon Sep 17 00:00:00 2001
From: FELD Boris <lothiraldan@gmail.com>
Date: Wed, 6 Apr 2011 09:36:32 +0200
Subject: [PATCH] Add support for translations in notmyidea-cms
---
notmyidea-cms/templates/article.html | 1 +
notmyidea-cms/templates/index.html | 1 +
notmyidea-cms/templates/translations.html | 6 ++++++
3 files changed, 8 insertions(+), 0 deletions(-)
create mode 100644 notmyidea-cms/templates/translations.html
diff --git a/notmyidea-cms/templates/article.html b/notmyidea-cms/templates/article.html
index 8b5e5ba..04eeea6 100644
--- a/notmyidea-cms/templates/article.html
+++ b/notmyidea-cms/templates/article.html
@@ -18,6 +18,7 @@
{% endif %}
<p>In <a href="{{ SITEURL }}/category/{{ article.category }}.html">{{ article.category }}</a>.
{% include 'taglist.html' %}
+ {% include 'translations.html' %}
</footer><!-- /.post-info -->
{{ article.content }}
</div><!-- /.entry-content -->
diff --git a/notmyidea-cms/templates/index.html b/notmyidea-cms/templates/index.html
index d822249..0a243b1 100644
--- a/notmyidea-cms/templates/index.html
+++ b/notmyidea-cms/templates/index.html
@@ -20,6 +20,7 @@
{% endif %}
<p>In <a href="{{ SITEURL }}/category/{{ article.category }}.html">{{ article.category }}</a>. {% if PDF_PROCESSOR %}<a href="{{ SITEURL }}/pdf/{{ article.slug }}.pdf">get the pdf</a>{% endif %}</p>
{% include 'taglist.html' %}
+ {% include 'translations.html' %}
</footer><!-- /.post-info -->
{{ article.content }}
</article></aside><!-- /#featured -->
diff --git a/notmyidea-cms/templates/translations.html b/notmyidea-cms/templates/translations.html
new file mode 100644
index 0000000..f0a0fa2
--- /dev/null
+++ b/notmyidea-cms/templates/translations.html
@@ -0,0 +1,6 @@
+{% if article.translations %}
+Translations:
+ {% for translation in article.translations %}
+ <a href="{{ SITEURL }}/{{ translation.url }}">{{ translation.lang }}</a>
+ {% endfor %}
+{% endif %}
\ No newline at end of file
--
1.7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment