Append domain_name in pages title

This commit is contained in:
2014-12-19 17:50:45 +01:00
parent d47a4609d8
commit ea32f7f0ae
4 changed files with 189 additions and 143 deletions

View File

@@ -27,6 +27,12 @@ import logging
# Create output HTML files
#
# Just for detection
def _(name): pass
_('January'), _('February'), _('March'), _('April'), _('May'), _('June'), _('July')
_('August'), _('September'), _('October'), _('November'), _('December')
del _
class DisplayHTMLRaw(object):
def __init__(self, iwla, html=u''):
@@ -370,6 +376,12 @@ def generateHTMLLink(url, name=None, max_length=100, prefix=u'http'):
return u'<a href="%s">%s</a>' % (url, name[:max_length])
def createCurTitle(iwla, title):
title = iwla._(title) + time.strftime(u' - %B %Y', iwla.getCurTime())
title = iwla._(title)
month_name = time.strftime(u'%B', iwla.getCurTime())
year = time.strftime(u'%Y', iwla.getCurTime())
title += u' - %s %s' % (iwla._(month_name), year)
domain_name = iwla.getConfValue('domain_name', '')
if domain_name:
title += u' - %s' % (domain_name)
return title