From 42b42c868ff3da1a120df0ec2be46a16fea54987 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 18 Jan 2026 19:19:54 -0400 Subject: content, data: MusicVideo.labelStyle --- src/content/dependencies/generateMusicVideo.js | 14 +++++++++++++- src/data/things/music-video.js | 11 ++++++++++- src/static/css/site.css | 5 +++++ src/strings-default.yaml | 1 + 4 files changed, 29 insertions(+), 2 deletions(-) (limited to 'src') 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} -- cgit 1.3.0-6-gf8a5