« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/page/art-tag.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/page/art-tag.js')
-rw-r--r--src/page/art-tag.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/page/art-tag.js b/src/page/art-tag.js
new file mode 100644
index 00000000..5b61229d
--- /dev/null
+++ b/src/page/art-tag.js
@@ -0,0 +1,35 @@
+// Art tag page specification.
+
+export const description = `per-art-tag info & 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: ['artTagInfo', tag.directory],
+
+      contentFunction: {
+        name: 'generateArtTagInfoPage',
+        args: [tag],
+      },
+    },
+
+    {
+      type: 'page',
+      path: ['artTagGallery', tag.directory],
+
+      contentFunction: {
+        name: 'generateArtTagGalleryPage',
+        args: [tag],
+      },
+    },
+  ];
+}