« 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/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/page/index.js')
-rw-r--r--src/page/index.js33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/page/index.js b/src/page/index.js
index d74dad5..384b419 100644
--- a/src/page/index.js
+++ b/src/page/index.js
@@ -3,7 +3,14 @@
 // homepage.js for that.
 //
 // Each module published in this list should follow a particular format,
-// including the following exports:
+// including any of the following exports:
+//
+// condition({wikiData})
+//     Returns a boolean indicating whether to process targets/writes (true) or
+//     skip this page spec altogether (false). This is usually used for
+//     selectively toggling pages according to site feature flags, though it may
+//     also be used to e.g. skip out if no targets would be found (preventing
+//     writeTargetless from generating an empty index page).
 //
 // targets({wikiData})
 //     Gets the objects which this page's write() function should be called on.
@@ -11,14 +18,21 @@
 //     but it may also apply filter/map/etc if useful.
 //
 // write(thing, {wikiData})
-//     Gets descriptors for any page and data writes associated with the given
-//     thing (which will be a value from the targets() array). This includes
-//     page (HTML) writes, data (JSON) writes, etc. Notably, this function does
-//     not perform any file operations itself; it only describes the operations
-//     which will be processed elsewhere, once for each translation language.
-//     The write function also immediately transforms any data which will be
-//     reused across writes of the same page, so that this data is effectively
-//     cached (rather than recalculated for each language/write).
+//     Provides descriptors for any page and data writes associated with the
+//     given thing (which will be a value from the targets() array). This
+//     includes page (HTML) writes, data (JSON) writes, etc. Notably, this
+//     function does not perform any file operations itself; it only describes
+//     the operations which will be processed elsewhere, once for each
+//     translation language.  The write function also immediately transforms
+//     any data which will be reused across writes of the same page, so that
+//     this data is effectively cached (rather than recalculated for each
+//     language/write).
+//
+// writeTargetless({wikiData})
+//     Provides descriptors for page/data/etc writes which will be used
+//     without concern for targets. This is usually used for writing index pages
+//     which should be generated just once (rather than corresponding to
+//     targets).
 //
 // As these modules are effectively the HTML templates for all site layout,
 // common patterns may also be exported alongside the special exports above.
@@ -29,4 +43,5 @@ export * as album from './album.js';
 export * as artist from './artist.js';
 export * as artistAlias from './artist-alias.js';
 export * as group from './group.js';
+export * as news from './news.js';
 export * as track from './track.js';