protected static function getSlug($path, $relativePath)
    {
        if (string_starts_with($path, $relativePath)) {
            $path = substr($path, strlen(Folder::slashTerm($relativePath)));
        }
        $path = preg_replace(sprintf('/\.[^\.]+$/'), null, $path);

        return DS == '/' ? $path : str_replace(DS, '/', $path);
    }
protected static function getSlug($path, $relativePath)
    {
        if (string_starts_with($path, $relativePath)) {
            $path = substr($path, strlen(Folder::slashTerm($relativePath)));
        }
        $path = preg_replace(sprintf('/\.[^\.]+$/'), null, $path);

        return DS == '/' ? $path : str_replace(DS, '/', $path);
    }
protected static function getSlug ( $ path , $ relativePath ) { if ( string_starts_with ( $ path , $ relativePath ) ) { $ path = substr ( $ path , strlen ( Folder :: slashTerm ( $ relativePath ) ) ) ; } $ path = preg_replace ( sprintf ( '/\.[^\.]+$/' ) , null , $ path ) ; return DS == '/' ? $ path : str_replace ( DS , '/' , $ path ) ; }
Internal method to get the slug.

It takes the full path and removes the relative path and the extension.
@param string $path Path
@param string $relativePath Relative path
@return string
Internal method to get the slug .