protected function getTermRelativePath($basePath, $permalinkTemplate, $term)
    {
        $result = $basePath;
        $slugedTerm = (new StringWrapper($term))->slug();
        $result .= '/'.str_replace(':name', $slugedTerm, $permalinkTemplate).'/index.html';

        return ltrim(preg_replace('/\/\/+/', '/', $result), '/');
    }