def METHOD_NAME(self, destination, lang, template):
    """Generates the sidebar task for the given language."""
    context = {}
    deps_dict = {}
    posts = self._build_post_list(lang, self.site.config.get("SIDEBAR_MAXIMUM_POST_COUNT", 10))
    context['global_posts'] = posts
    deps_dict['global_posts'] = [(post.permalink(lang), post.title(lang), post.date) for post in posts]
    for taxonomy in self.site.taxonomy_plugins.keys():
        taxonomy_items, taxonomy_hierarchy = self._build_taxonomy_list_and_hierarchy(taxonomy, lang)
        context['global_{}_items'.format(taxonomy)] = taxonomy_items
        context['global_{}_hierarchy'.format(taxonomy)] = taxonomy_hierarchy
        deps_dict['global_{}_hierarchy'.format(taxonomy)] = taxonomy_hierarchy
    url_type = self.site.config['URL_TYPE']
    if url_type == 'rel_path':
        url_type = 'full_path'
    task = self.site.generic_renderer(lang, destination, template, self.site.config['FILTERS'], context=context, context_deps_remove=['global_posts'], post_deps_dict=deps_dict, url_type=url_type, is_fragment=True)
    task['basename'] = self.name
    yield task