Change track slug to include album slug

The previous `slug` is now in `trackSlug` instead. This approach offers more flexibility when configuring permalinks in Jekyll.
This commit is contained in:
Lynn Smeria 2018-11-19 13:10:57 +01:00
parent a0cc2e4927
commit d186a5398e

View file

@ -88,13 +88,15 @@ module.exports = {
const newPath = path.resolve(assetRoot, folderName, fileName);
await fs.copyFile(file.path, newPath);
const coverPath = await extractCoverArt(newPath);
const trackSlug = stripExtension(fileName);
return _.assign(
{},
{
path: newPath,
audio: `/assets/albums/${folderName}/${fileName}`,
slug: `${folderName}/${trackSlug}`,
albumSlug: folderName,
slug: stripExtension(fileName),
trackSlug,
},
coverPath
? {