Beispiel #1
0
 def set_site(self, site):
     """Set Nikola site."""
     super(ClassifySections, self).set_site(site)
     self.show_list_as_index = site.config["POSTS_SECTIONS_ARE_INDEXES"]
     self.template_for_single_list = "sectionindex.tmpl" if self.show_list_as_index else "list.tmpl"
     self.enable_for_lang = {}
     self.translation_manager = utils.ClassificationTranslationManager()
Beispiel #2
0
 def set_site(self, site):
     """Set Nikola site."""
     super().set_site(site)
     self.show_list_as_index = site.config['AUTHOR_PAGES_ARE_INDEXES']
     self.more_than_one_classifications_per_post = site.config.get('MULTIPLE_AUTHORS_PER_POST', False)
     self.template_for_single_list = "authorindex.tmpl" if self.show_list_as_index else "author.tmpl"
     self.translation_manager = utils.ClassificationTranslationManager()
Beispiel #3
0
 def set_site(self, site):
     """Set site, which is a Nikola instance."""
     super(ClassifyCategories, self).set_site(site)
     self.show_list_as_index = self.site.config[
         'CATEGORY_PAGES_ARE_INDEXES']
     self.template_for_single_list = "tagindex.tmpl" if self.show_list_as_index else "tag.tmpl"
     self.translation_manager = utils.ClassificationTranslationManager()
Beispiel #4
0
 def set_site(self, site):
     """Set site, which is a Nikola instance."""
     super(ClassifyTags, self).set_site(site)
     self.show_list_as_index = self.site.config['TAG_PAGES_ARE_INDEXES']
     self.template_for_single_list = "tagindex.tmpl" if self.show_list_as_index else "tag.tmpl"
     self.minimum_post_count_per_classification_in_overview = self.site.config['TAGLIST_MINIMUM_POSTS']
     self.translation_manager = utils.ClassificationTranslationManager()
Beispiel #5
0
    def set_site(self, site):
        """Set site, which is a Nikola instance."""
        super().set_site(site)
        self.show_list_as_index = self.site.config['CATEGORY_PAGES_ARE_INDEXES']
        self.template_for_single_list = "tagindex.tmpl" if self.show_list_as_index else "tag.tmpl"
        self.translation_manager = utils.ClassificationTranslationManager()

        # Needed to undo names for CATEGORY_PAGES_FOLLOW_DESTPATH
        self.destpath_names_reverse = {}
        for lang in self.site.config['TRANSLATIONS']:
            self.destpath_names_reverse[lang] = {}
            for k, v in self.site.config['CATEGORY_DESTPATH_NAMES'](lang).items():
                self.destpath_names_reverse[lang][v] = k
        self.destpath_names_reverse = utils.TranslatableSetting(
            '_CATEGORY_DESTPATH_NAMES_REVERSE', self.destpath_names_reverse,
            self.site.config['TRANSLATIONS'])
 def set_site(self, site):
     """Set site, which is a Nikola instance."""
     super().set_site(site)
     self.minimum_post_count_per_classification_in_overview = self.site.config[
         "TAGLIST_MINIMUM_POSTS"]
     self.translation_manager = utils.ClassificationTranslationManager()
     self.pages_index_path = utils.TranslatableSetting(
         "TAGGED_PAGES_INDEX_PATH",
         self.site.config["TAGGED_PAGES_INDEX_PATH"],
         self.site.config["TRANSLATIONS"],
     )
     self.pages_path = utils.TranslatableSetting(
         "TAGGED_PAGES_PATH",
         self.site.config["TAGGED_PAGES_PATH"],
         self.site.config["TRANSLATIONS"],
     )
Beispiel #7
0
 def set_site(self, site):
     """Set Nikola site."""
     super(ClassifyAuthors, self).set_site(site)
     self.show_list_as_index = site.config['AUTHOR_PAGES_ARE_INDEXES']
     self.template_for_single_list = "authorindex.tmpl" if self.show_list_as_index else "author.tmpl"
     self.translation_manager = utils.ClassificationTranslationManager()