« get me outta code hell

artist-alias.js « page « src - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/artist-alias.js
blob: ac23e9027fc773ef6e53b376af4b36c321f11557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Artist alias redirect pages.
// (Makes old permalinks bring visitors to the up-to-date page.)

export function targets({wikiData}) {
    return wikiData.artistAliasData;
}

export function write(aliasArtist, {wikiData}) {
    // This function doesn't actually use wikiData, 8ut, um, consistency?

    const { aliasedArtist } = aliasArtist;

    const redirect = {
        type: 'redirect',
        fromPath: ['artist', aliasArtist.directory],
        toPath: ['artist', aliasedArtist.directory],
        title: () => aliasedArtist.name
    };

    return [redirect];
}