add ids to people

This commit is contained in:
tree🌴 2024-02-02 05:28:04 +01:00
parent 047f81ebe4
commit 5c7f56aeb9
3 changed files with 7 additions and 1 deletions

View File

@ -81,6 +81,9 @@ $defs:
required: required:
- name - name
properties: properties:
id:
type: string
pattern: "^[a-z0-9-]+$"
name: name:
type: string type: string
caption: caption:

View File

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 132 KiB

View File

@ -55,7 +55,10 @@ export class Engine {
arr.push(obj); arr.push(obj);
} }
if (ext === "yaml" && fn !== "index") { if (ext === "yaml" && fn !== "index") {
const item = await readYamlFile(join(dir, dirEntry.name)); const item = Object.assign(
{ id: fn },
await readYamlFile(join(dir, dirEntry.name)),
);
if (opts.loader === "person") { if (opts.loader === "person") {
// load image // load image
const img = images.find((i) => i.id === fn); const img = images.find((i) => i.id === fn);