Exemple #1
0
    def gen_tasks(self):
        """Build HTML fragments from metadata and text."""
        self.site.scan_posts()
        kw = {
            "translations": self.site.config["TRANSLATIONS"],
            "timeline": self.site.timeline,
            "default_lang": self.site.config["DEFAULT_LANG"],
            "hide_untranslated_posts": self.site.config['HIDE_UNTRANSLATED_POSTS'],
        }

        nikola.post.READ_MORE_LINK = self.site.config['READ_MORE_LINK']
        yield self.group_task()

        for lang in kw["translations"]:
            deps_dict = copy(kw)
            deps_dict.pop('timeline')
            for post in kw['timeline']:
                dest = post.translated_base_path(lang)
                task = {
                    'basename': self.name,
                    'name': dest,
                    'file_dep': post.fragment_deps(lang),
                    'targets': [dest],
                    'actions': [(post.compile, (lang, ))],
                    'clean': True,
                    'uptodate': [utils.config_changed(deps_dict)],
                }
                yield task
 def get_dep_filename(self, post: 'nikola.post.Post', lang: str) -> str:
     """Return the .dep file's name for the given post and language."""
     return post.translated_base_path(lang) + '.dep'
Exemple #3
0
 def get_dep_filename(self, post: 'nikola.post.Post', lang: str) -> str:
     """Return the .dep file's name for the given post and language."""
     return post.translated_base_path(lang) + '.dep'