Example #1
0
    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
Example #2
0
 def __init__(self, stopwords):
     self.__index = Index()
     self.__preprocessor = Preprocessor()
     self.__sw = stopwords
Example #3
0
 def index_highlight_posts(self):
     return self.__get_data('index_highlight_posts', Index(),
                            'highlight_posts')
Example #4
0
 def index_spotlight_posts(self):
     return self.__get_data('index_spotlight_posts', Index(),
                            'spotlight_posts')
Example #5
0
 def index_max_posts(self):
     return self.__get_data('index_max_posts', Index(), 'max_posts')
Example #6
0
 def index_footer_menu(self):
     return self.__get_data('index_footer_menu', Index(), 'footer_menu')
Example #7
0
 def index_main_menu(self):
     return self.__get_data('index_main_menu', Index(), 'main_menu')