1
0
Fork 0
forked from github/pelican

Update the documentations and fix some little things about the translation feature.

This commit is contained in:
Alexis Metaireau 2010-12-20 22:50:54 +00:00
commit 750e211649
4 changed files with 14 additions and 1 deletions

View file

@ -87,3 +87,11 @@ generate static pages.
Then, use the `DISPLAY_PAGES_ON_MENU` setting, which will add all the pages to
the menu.
Translations
============
It is possible to translate articles. To do so, you need to add a `Lang` meta
in your articles/pages, and to set a `DEFAULT_LANG` setting (which is en by
default). Then, only articles with this default language will be listed, and
each article will have a translation list.

View file

@ -31,6 +31,7 @@ Setting name what it does ?
`CSS_FILE` To specify the CSS file you want to load, if it's not
the default one ('main.css')
`DEFAULT_CATEGORY` The default category to fallback on. `misc` by default.
`DEFAULT_LANG` The default language to use. Default is 'en'.
`DISPLAY_PAGES_ON_MENU` Display or not the pages on the menu of the template.
Templates can follow or not this settings.
`FALLBACK_ON_FS_DATE` If True, pelican will use the file system dates infos
@ -62,6 +63,9 @@ Setting name what it does ?
`THEME` theme to use to product the output. can be the
complete static path to a theme folder, or chosen
between the list of default themes (see below)
`TRANSLATION_FEED` Where to put the RSS feed for translations. Default
is feeds/all-%s.atom.xml where %s is the name of the
lang.
======================= =======================================================
Themes

View file

@ -22,7 +22,7 @@ class Page(object):
if 'AUTHOR' in settings:
self.author = settings['AUTHOR']
default_lang = settings.get('DEFAULT_LANG', 'en').lower()
default_lang = settings.get('DEFAULT_LANG').lower()
if not hasattr(self, 'lang'):
self.lang = default_lang

View file

@ -20,6 +20,7 @@ _DEFAULT_CONFIG = {'PATH': None,
'REVERSE_ARCHIVE_ORDER': False,
'KEEP_OUTPUT_DIRECTORY': False,
'CLEAN_URLS': False, # use /blah/ instead /blah.html in urls
'DEFAULT_LANG': 'en',
}
def read_settings(filename):