From a1bfa1d0d68890ebd5811bd46455d10be4bbc17d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 4 Oct 2023 13:16:50 -0300 Subject: support art tag info pages; ensure "art tag" terminology everywhere --- src/page/art-tag.js | 25 +++++++++++++++++++++++++ src/page/index.js | 2 +- src/page/tag.js | 25 ------------------------- 3 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 src/page/art-tag.js delete mode 100644 src/page/tag.js (limited to 'src/page') diff --git a/src/page/art-tag.js b/src/page/art-tag.js new file mode 100644 index 00000000..32e869e1 --- /dev/null +++ b/src/page/art-tag.js @@ -0,0 +1,25 @@ +// Art tag page specification. + +export const description = `per-art-tag gallery pages`; + +export function condition({wikiData}) { + return wikiData.wikiInfo.enableArtTagUI; +} + +export function targets({wikiData}) { + return wikiData.artTagData.filter((tag) => !tag.isContentWarning); +} + +export function pathsForTarget(tag) { + return [ + { + type: 'page', + path: ['artTagGallery', tag.directory], + + contentFunction: { + name: 'generateArtTagGalleryPage', + args: [tag], + }, + }, + ]; +} diff --git a/src/page/index.js b/src/page/index.js index 48e22d2e..557384a6 100644 --- a/src/page/index.js +++ b/src/page/index.js @@ -1,11 +1,11 @@ export * as album from './album.js'; export * as artist from './artist.js'; export * as artistAlias from './artist-alias.js'; +export * as artTag from './art-tag.js'; export * as flash from './flash.js'; export * as group from './group.js'; export * as homepage from './homepage.js'; export * as listing from './listing.js'; export * as news from './news.js'; export * as static from './static.js'; -export * as tag from './tag.js'; export * as track from './track.js'; diff --git a/src/page/tag.js b/src/page/tag.js deleted file mode 100644 index 8942aea9..00000000 --- a/src/page/tag.js +++ /dev/null @@ -1,25 +0,0 @@ -// Art tag page specification. - -export const description = `per-artwork-tag gallery pages`; - -export function condition({wikiData}) { - return wikiData.wikiInfo.enableArtTagUI; -} - -export function targets({wikiData}) { - return wikiData.artTagData.filter((tag) => !tag.isContentWarning); -} - -export function pathsForTarget(tag) { - return [ - { - type: 'page', - path: ['tag', tag.directory], - - contentFunction: { - name: 'generateArtTagGalleryPage', - args: [tag], - }, - }, - ]; -} -- cgit 1.3.0-6-gf8a5