def index_data(self, page_index): key = '/index/{0}'.format(page_index) if Options().caching and DataCacher().cached_already(key): return DataCacher().get_cached(key) common = self.common_data if Options().include_drafts: posts = self.posts_files else: posts = self.posts_published data, _ = Index().data(page_index, posts) # We don't care yet about the introduction content combined = self.__combine(common, data) if Options().caching: DataCacher().cache(key, combined) return combined
def __init__(self, stopwords): self.__index = Index() self.__preprocessor = Preprocessor() self.__sw = stopwords
def index_highlight_posts(self): return self.__get_data('index_highlight_posts', Index(), 'highlight_posts')
def index_spotlight_posts(self): return self.__get_data('index_spotlight_posts', Index(), 'spotlight_posts')
def index_max_posts(self): return self.__get_data('index_max_posts', Index(), 'max_posts')
def index_footer_menu(self): return self.__get_data('index_footer_menu', Index(), 'footer_menu')
def index_main_menu(self): return self.__get_data('index_main_menu', Index(), 'main_menu')