/**
  * {@inheritdoc}
  */
 public function create(SourceInterface $source)
 {
     if ($source->canBeFormatted()) {
         $relativeFilePath = $this->generatePermalinkPathname($source);
         // TODO: Make this configurable... not all index files are named index.*
         if (strpos(basename($relativeFilePath), 'index.') === false) {
             $relativeUrlPath = $relativeFilePath;
         } else {
             $relativeUrlPath = '/' . dirname($relativeFilePath);
         }
         if ($relativeUrlPath == '/.') {
             $relativeUrlPath = '/';
         }
     } else {
         $relativeFilePath = $relativeUrlPath = $source->relativePathname();
     }
     if (0 !== strpos($relativeUrlPath, '/')) {
         $relativeUrlPath = '/' . $relativeUrlPath;
     }
     return new Permalink($relativeFilePath, $relativeUrlPath);
 }