code: def generate_output(self, writer=None):
          '''
          Generate redirect files
          '''
          logger.info(
              'Generating permalink files in %r', self.permalink_output_path)
  
          clean_output_dir(self.permalink_output_path, [])
          mkdir_p(self.permalink_output_path)
          for content in itertools.chain(
                  self.context['articles'], self.context['pages']):
  
              for permalink_id in content.get_permalink_ids_iter():
                  permalink_path = os.path.join(
                      self.permalink_output_path, permalink_id) + '.html'
  
                  redirect_string = REDIRECT_STRING.format(
                      url=article_url(content),
                      title=content.title)
                  open(permalink_path, 'w').write(redirect_stringf generate_output(self, writer=None):
          '''
          Generate redirect files
          '''
          logger.info(
              'Generating permalink files in %r', self.permalink_output_path)
  
          clean_output_dir(self.permalink_output_path, [])
          mkdir_p(self.permalink_output_path)
          for content in itertools.chain(
                  self.context['articles'], self.context['pages']):
  
              for permalink_id in content.get_permalink_ids_iter():
                  permalink_path = os.path.join(
                      self.permalink_output_path, permalink_id) + '.html'
  
                  redirect_string = REDIRECT_STRING.format(
                      url=article_url(content),
                      title=content.title)
                  open(permalink_path, 'w').write(redirect_string)
docs: Generate redirect files