« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/content/dependencies/generateMusicVideo.js14
-rw-r--r--src/data/things/music-video.js11
-rw-r--r--src/static/css/site.css5
-rw-r--r--src/strings-default.yaml1
4 files changed, 29 insertions, 2 deletions
diff --git a/src/content/dependencies/generateMusicVideo.js b/src/content/dependencies/generateMusicVideo.js
index 035cd353..a481cb16 100644
--- a/src/content/dependencies/generateMusicVideo.js
+++ b/src/content/dependencies/generateMusicVideo.js
@@ -21,6 +21,9 @@ export default {
     label:
       musicVideo.label,
 
+    labelStyle:
+      musicVideo.labelStyle,
+
     url:
       musicVideo.url,
   }),
@@ -29,12 +32,21 @@ export default {
     language.encapsulate('misc.musicVideo', capsule =>
       html.tag('div', {class: 'music-video'}, [
         html.tag('p', {class: 'music-video-label'},
+          data.labelStyle !== 'label' &&
+            {class: data.labelStyle + '-style'},
+
           language.encapsulate(capsule, 'label', workingCapsule => {
             const workingOptions = {};
 
             if (data.label) {
               workingCapsule += '.customLabel';
-              workingOptions.label = data.label;
+
+              if (data.labelStyle === 'title') {
+                workingCapsule += '.title';
+                workingOptions.title = data.label;
+              } else {
+                workingOptions.label = data.label;
+              }
             }
 
             return language.$(workingCapsule, workingOptions);
diff --git a/src/data/things/music-video.js b/src/data/things/music-video.js
index f8baa2a2..20f201cc 100644
--- a/src/data/things/music-video.js
+++ b/src/data/things/music-video.js
@@ -4,7 +4,7 @@ import {colors} from '#cli';
 import {input, V} from '#composite';
 import find from '#find';
 import Thing from '#thing';
-import {isDate, isStringNonEmpty, isURL} from '#validators';
+import {is, isDate, isStringNonEmpty, isURL} from '#validators';
 import {parseContributors, parseDate} from '#yaml';
 
 import {constituteFrom} from '#composite/wiki-data';
@@ -42,6 +42,14 @@ export class MusicVideo extends Thing {
       expose: {transform: value => value ?? 'Music video'},
     },
 
+    labelStyle: {
+      flags: {update: true, expose: true},
+      update: {
+        validate:
+          is('label', 'title'),
+      },
+    },
+
     unqualifiedDirectory: directory({name: 'label'}),
 
     date: [
@@ -85,6 +93,7 @@ export class MusicVideo extends Thing {
   static [Thing.yamlDocumentSpec] = {
     fields: {
       'Label': {property: 'label'},
+      'Label Style': {property: 'labelStyle'},
       'Directory': {property: 'unqualifiedDirectory'},
       'Date': {property: 'date', transform: parseDate},
       'URL': {property: 'url'},
diff --git a/src/static/css/site.css b/src/static/css/site.css
index 71beae4a..cbbe772e 100644
--- a/src/static/css/site.css
+++ b/src/static/css/site.css
@@ -1897,6 +1897,11 @@ p.image-details.origin-details .filename-line {
   text-align: center;
 }
 
+.music-video .music-video-label.title-style {
+  margin-bottom: 4px;
+  font-style: oblique;
+}
+
 .music-video .image-container ~ p {
   margin: 3px 5px;
 }
diff --git a/src/strings-default.yaml b/src/strings-default.yaml
index ee214d59..28a5902c 100644
--- a/src/strings-default.yaml
+++ b/src/strings-default.yaml
@@ -994,6 +994,7 @@ misc:
   musicVideo:
     label: "Music video!"
     label.customLabel: "{LABEL}!"
+    label.customLabel.title: "{TITLE}"
 
     artistsLine: >-
       Music video {CREDIT}