Update README

This commit is contained in:
Iacopo Spalletti 2015-10-31 01:26:06 +01:00
parent c23d86208d
commit bb17b71158
3 changed files with 17 additions and 11 deletions

View file

@ -311,6 +311,10 @@ Global Settings
(default: ``Blog``)
* BLOG_AUTO_APP_TITLE: Title of the ``BlogConfig`` instance created by
**Auto setup**; (default: ``Blog``)
* BLOG_SITEMAP_PRIORITY_DEFAULT: Default priority for sitemap items; (default: ``0.5``)
* BLOG_SITEMAP_CHANGEFREQ: List for available changefreqs for sitemap items; (default: **always**,
**hourly**, **daily**, **weekly**, **monthly**, **yearly**, **never**)
* BLOG_SITEMAP_CHANGEFREQ_DEFAULT: Default changefreq for sitemap items; (default: ``monthly``)
Per-Apphook settings
--------------------
@ -327,6 +331,8 @@ Per-Apphook settings
* Paginate sizePer-Apphook setting for BLOG_PAGINATION;
* Template prefix: Alternative directory to load the blog templates from;
* Menu structure: Per-Apphook setting for BLOG_MENU_TYPE
* Sitemap changefreq: Per-Apphook setting for BLOG_SITEMAP_CHANGEFREQ_DEFAULT
* Sitemap priority: Per-Apphook setting for BLOG_SITEMAP_PRIORITY_DEFAULT
* Object type: Per-Apphook setting for BLOG_TYPE
* Facebook type: Per-Apphook setting for BLOG_FB_TYPE
* Facebook application ID: Per-Apphook setting for BLOG_FB_APP_ID

View file

@ -64,7 +64,7 @@ class BlogConfigForm(AppDataForm):
)
sitemap_changefreq = forms.ChoiceField(
label=_('Sitemap changefreq'), required=True,
choices=get_setting('SITEMAP_CHANGEFREQ').items(),
choices=get_setting('SITEMAP_CHANGEFREQ'),
initial=get_setting('SITEMAP_CHANGEFREQ_DEFAULT'),
help_text=_('Changefreq attribute for sidebar items')
)

View file

@ -30,15 +30,15 @@ def get_setting(name):
(MENU_TYPE_POSTS, _('Posts only')),
(MENU_TYPE_NONE, _('None')),
)
SITEMAP_CHANGEFREQ_LIST = {
'always': _('always'),
'hourly': _('hourly'),
'daily': _('daily'),
'weekly': _('weekly'),
'monthly': _('monthly'),
'yearly': _('yearly'),
'never': _('never'),
}
SITEMAP_CHANGEFREQ_LIST = (
('always', _('always')),
('hourly', _('hourly')),
('daily', _('daily')),
('weekly', _('weekly')),
('monthly', _('monthly')),
('yearly', _('yearly')),
('never', _('never')),
)
default = {
'BLOG_IMAGE_THUMBNAIL_SIZE': getattr(settings, 'BLOG_IMAGE_THUMBNAIL_SIZE', {
'size': '120x120',
@ -98,7 +98,7 @@ def get_setting(name):
settings, 'BLOG_SITEMAP_CHANGEFREQ', SITEMAP_CHANGEFREQ_LIST
),
'BLOG_SITEMAP_CHANGEFREQ_DEFAULT': getattr(
settings, 'BLOG_SITEMAP_CHANGEFREQ_DEFAULT', list(SITEMAP_CHANGEFREQ_LIST.keys())[0]
settings, 'BLOG_SITEMAP_CHANGEFREQ_DEFAULT', 'monthly'
),
'BLOG_ENABLE_SEARCH': getattr(settings, 'BLOG_ENABLE_SEARCH', True),