diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/page/tag.js | 51 | ||||
-rwxr-xr-x | src/upd8.js | 2 |
2 files changed, 42 insertions, 11 deletions
diff --git a/src/page/tag.js b/src/page/tag.js index 39bfda60..9ef3d8c3 100644 --- a/src/page/tag.js +++ b/src/page/tag.js @@ -28,6 +28,7 @@ export function write(tag, {wikiData}) { type: 'page', path: ['tag', tag.directory], page: ({ + generatePreviousNextLinks, getAlbumCover, getGridHTML, getThemeString, @@ -60,20 +61,48 @@ export function write(tag, {wikiData}) { ` }, - nav: { - links: [ - {toHome: true}, - wikiInfo.features.listings && - { - path: ['localized.listingIndex'], - title: strings('listingIndex.title') - }, - {toCurrentPage: true} - ] - } + nav: generateTagNav(tag, { + generatePreviousNextLinks, + link, + strings, + wikiData + }) }) }; return [page]; } +// Utility functions + +function generateTagNav(tag, { + generatePreviousNextLinks, + link, + strings, + wikiData +}) { + const previousNextLinks = generatePreviousNextLinks(tag, { + data: wikiData.tagData.filter(tag => !tag.isCW), + linkKey: 'tag' + }); + + return { + links: [ + {toHome: true}, + wikiData.wikiInfo.features.listings && + { + path: ['localized.listingIndex'], + title: strings('listingIndex.title') + }, + { + html: strings('tagPage.nav.tag', { + tag: link.tag(tag, {class: 'current'}) + }) + }, + previousNextLinks && { + divider: false, + html: `(${previousNextLinks})` + } + ] + }; +} diff --git a/src/upd8.js b/src/upd8.js index 8652f65c..e2a5b734 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -2449,6 +2449,8 @@ async function main() { } } + WD.tagData.sort(sortByName); + WD.groupData = await processGroupDataFile(path.join(dataPath, GROUP_DATA_FILE)); if (WD.groupData.error) { console.log(`\x1b[31;1m${WD.groupData.error}\x1b[0m`); |