code: def get_permalink_path(self):
      
      try:
          first_permalink_id = next(self.get_permalink_ids_iter())
      except StopIteration:
          return None
  
      return '/{settings[PERMALINK_PATH]}/{first_permalink}.html'.format(
          settings=self.settings, first_permalink=first_permalink_id)
docs: Get just path component of permalink.