From e9eb08953d9ff25c23d67168d7b9d47599425f42 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 1 May 2024 19:57:00 -0300 Subject: urls: factor out generic reused root/path subkeys --- src/url-spec.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/url-spec.js b/src/url-spec.js index ea5337a2..8537dfe0 100644 --- a/src/url-spec.js +++ b/src/url-spec.js @@ -1,12 +1,16 @@ import {withEntries} from '#sugar'; +const genericPaths = { + root: '', + path: '<>/', +}; + const urlSpec = { data: { prefix: 'data/', paths: { - root: '', - path: '<>', + ...genericPaths, album: 'album/<>', artist: 'artist/<>', @@ -19,8 +23,7 @@ const urlSpec = { // prefix: '_languageCode', paths: { - root: '', - path: '<>', + ...genericPaths, page: '<>/', home: '', @@ -61,8 +64,7 @@ const urlSpec = { shared: { paths: { - root: '', - path: '<>', + ...genericPaths, utilityRoot: 'util', staticRoot: 'static', @@ -78,8 +80,7 @@ const urlSpec = { prefix: 'media/', paths: { - root: '', - path: '<>', + ...genericPaths, albumAdditionalFile: 'album-additional/<>/<>', albumBanner: 'album-art/<>/banner.<>', @@ -96,11 +97,7 @@ const urlSpec = { thumb: { prefix: 'thumb/', - - paths: { - root: '', - path: '<>', - }, + paths: genericPaths, }, }; -- cgit 1.3.0-6-gf8a5