Пример #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)
Пример #2
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)