hyde/hyde — pull request #165 by gfuchedzhy (2012-03-18 08:54:25+00:00)
Title: Lang extension

This patch extends language plugin written by Vincent Bernat. It adds new way of specifying localized resources. Now you can add files photo.en.jpg and photo.ru.jpg and they will be recognized by hyde as translations of each other. This is equivalent to specifying meta.language and meta.uuid for those files. Also smart deployment of localized resources added, it eventually became separate smart urls plugin. Here is how it works, lets say you have following content and smart urls plugin enabled:

content/
index.en.html
index.ru.html
index.fr.html
photo.en.jpg
photo.ru.jpg
photo.jpg

Let all index files have identical content {{content_url('photo.jpg')}}, note that we do not use language in reference to the file. Also note that fr do not have localized photo.jpg.

This will generate following deploy:

deploy/
photo.jpg
en/
index.html
photo.jpg
ru/
index.html
photo.jpg
fr/
index.html

en/index.html will contain /en/photo.jpg
ru/index.html will contain /ru/photo.jpg
fr/index.html will contain /photo.jpg as it doesn't have localized photo

If later you've got one for fr, all you need is to add appropriate photo.fr.jpg file and rebuild site. Hyde will automatically use localized version if it is available.

This plugin plays well with other plugins like urlcleaner, thumbnails and tagger.

Also with some apache mod_rewrite magic you can get site which behaves like this: http://pbu-devs.com
I have done blog for it, it's not published yet, but soon I'll publish it. Everything works fine with tagger plugin. Unfortunately I can't share sources of this site, but I'm ready to help users to get similar layout using mailing list or maybe by writing some minimal example.

First pull request 164 should be merged.