From d186a5398e6d18a8b277d6a368e79051a5200974 Mon Sep 17 00:00:00 2001 From: Lynn Smeria Date: Mon, 19 Nov 2018 13:10:57 +0100 Subject: [PATCH] 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. --- src/organise.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/organise.js b/src/organise.js index 42d440a..b90f0cb 100644 --- a/src/organise.js +++ b/src/organise.js @@ -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 ? {