diff options
author | (quasar) nebula <towerofnix@gmail.com> | 2021-06-04 15:29:18 -0300 |
---|---|---|
committer | (quasar) nebula <towerofnix@gmail.com> | 2021-06-04 15:29:18 -0300 |
commit | 1343a0e1e70994909dbcdd943ed7a53f61ea3b2b (patch) | |
tree | 85b35719865bd7fdb1811757667ddc09d0f392af /src/url-spec.js | |
parent | a735545f1442d9aab870ce34c76d43487f7ed547 (diff) |
move url spec into its own file
Diffstat (limited to 'src/url-spec.js')
-rw-r--r-- | src/url-spec.js | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/src/url-spec.js b/src/url-spec.js new file mode 100644 index 00000000..22b3bc8b --- /dev/null +++ b/src/url-spec.js @@ -0,0 +1,92 @@ +import {withEntries} from './util/sugar.js'; + +const urlSpec = { + data: { + prefix: 'data/', + + paths: { + root: '', + path: '<>', + + album: 'album/<>', + artist: 'artist/<>', + track: 'track/<>' + } + }, + + localized: { + // TODO: Implement this. + // prefix: '_languageCode', + + paths: { + root: '', + path: '<>', + + home: '', + + album: 'album/<>/', + albumCommentary: 'commentary/album/<>/', + + artist: 'artist/<>/', + artistGallery: 'artist/<>/gallery/', + + commentaryIndex: 'commentary/', + + flashIndex: 'flash/', + flash: 'flash/<>/', + + groupInfo: 'group/<>/', + groupGallery: 'group/<>/gallery/', + + listingIndex: 'list/', + listing: 'list/<>/', + + newsIndex: 'news/', + newsEntry: 'news/<>/', + + staticPage: '<>/', + tag: 'tag/<>/', + track: 'track/<>/' + } + }, + + shared: { + paths: { + root: '', + path: '<>', + + utilityRoot: 'util', + staticRoot: 'static', + + utilityFile: 'util/<>', + staticFile: 'static/<>' + } + }, + + media: { + prefix: 'media/', + + paths: { + root: '', + path: '<>', + + albumCover: 'album-art/<>/cover.jpg', + albumWallpaper: 'album-art/<>/bg.jpg', + albumBanner: 'album-art/<>/banner.jpg', + trackCover: 'album-art/<>/<>.jpg', + artistAvatar: 'artist-avatar/<>.jpg', + flashArt: 'flash-art/<>.jpg' + } + } +}; + +// This gets automatically switched in place when working from a baseDirectory, +// so it should never be referenced manually. +urlSpec.localizedWithBaseDirectory = { + paths: withEntries( + urlSpec.localized.paths, + entries => entries.map(([key, path]) => [key, '<>/' + path]) + ) +}; + +export default urlSpec; |