Exemplo n.º 1
0
 def section_color(self, lang=None):
     """Return the color of the post's section."""
     slug = self.section_slug(lang)
     if slug in self.config['POSTS_SECTION_COLORS'](lang):
         return self.config['POSTS_SECTION_COLORS'](lang)[slug]
     base = self.config['THEME_COLOR']
     return utils.colorize_str_from_base_color(slug, base)
Exemplo n.º 2
0
Arquivo: post.py Projeto: habi/nikola
 def section_color(self, lang=None):
     """Return the color of the post's section."""
     slug = self.section_slug(lang)
     if slug in self.config['POSTS_SECTION_COLORS'](lang):
         return self.config['POSTS_SECTION_COLORS'](lang)[slug]
     base = self.config['THEME_COLOR']
     return utils.colorize_str_from_base_color(slug, base)